:root {
  font-family: Geist, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #241e3e;
  background: #f5f2fb;
  font-synthesis: none;
  --ink: #241e3e;
  --muted: #615976;
  --paper: #fffefd;
  --line: #e7dff0;
  --violet: #5441a3;
  --soft: #ede7fa;
  --green: #247255;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; min-height: 100vh; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8668e6; outline-offset: 3px; }
a { color: inherit; }
h1, h2, p { margin: 0; }
h1 { line-height: 1.16; letter-spacing: -.035em; }
h2 { font-size: 1.45rem; }
p { line-height: 1.65; }
small { display: block; }
.muted { color: var(--muted); }
.small, small { font-size: .81rem; }
.topbar { max-width: 1240px; margin-inline: auto; padding: 24px clamp(16px, 5vw, 66px); display: flex; justify-content: space-between; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.5rem; letter-spacing: -.055em; font-weight: 750; }
.brand-mark { position: relative; width: 32px; height: 32px; border-radius: 11px; background: var(--violet); }
.brand-mark::before, .brand-mark::after { content: ''; position: absolute; height: 10px; width: 15px; border-radius: 5px 5px 5px 2px; }
.brand-mark::before { top: 8px; left: 7px; background: #fff; }
.brand-mark::after { bottom: 7px; right: 6px; background: #c4b3fa; border: 1px solid var(--violet); }
.top-link, .text-link { font-size: .9rem; color: var(--muted); text-underline-offset: 4px; }
.top-link:hover, .text-link:hover { color: var(--violet); }
.loading { margin: 12vh auto; text-align: center; color: var(--muted); }
.welcome { width: min(1080px, calc(100% - 48px)); margin: clamp(14px, 6vh, 64px) auto; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(28px, 6vw, 80px); }
.intro { position: relative; min-width: 0; }
.intro h1 { font-size: clamp(2.1rem, 4.6vw, 3.8rem); line-height: 1.22; font-weight: 760; }
.intro > p { margin: 19px 0; max-width: 23rem; color: var(--muted); }
.art { height: 150px; width: 255px; position: relative; margin: 0 0 26px; overflow: hidden; }
.orbit { position: absolute; border: 1px solid #dcd1ef; border-radius: 50%; transform: rotate(-24deg); }
.orbit-one { inset: 34px 10px 28px 1px; }
.orbit-two { inset: 14px 25px 9px 11px; }
.bubble { position: absolute; display: flex; justify-content: center; align-items: center; gap: 6px; height: 57px; border-radius: 21px; width: 95px; box-shadow: 0 9px 24px #39296e1a; }
.bubble i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.art-first { top: 31px; left: 39px; background: #5441a3; color: #ece4ff; transform: rotate(-10deg); border-bottom-left-radius: 5px; }
.art-second { top: 68px; left: 117px; background: #e4d8f9; color: #5441a3; transform: rotate(11deg); border-bottom-right-radius: 5px; }
.spark { width: 9px; height: 9px; border-radius: 3px; position: absolute; top: 34px; right: 35px; background: #e6aa5e; transform: rotate(45deg); }
.privacy-note, .room-status { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; background: #ae9fc7; border-radius: 50%; }
.privacy-note .status-dot, .status-dot.active { background: #429775; }
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: 21px; box-shadow: 0 12px 40px #3b275607; }
.setup { padding: clamp(20px, 4vw, 40px); }
.setup > p { margin: 9px 0 22px; }
form { margin: 0; }
fieldset { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
legend { font-weight: 650; padding: 0; margin-bottom: 9px; }
.choices, .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 9px; cursor: pointer; }
.choice:has(input:checked) { border-color: #a695dc; background: var(--soft); }
.choice input { flex: 0 0 auto; margin: 0; accent-color: var(--violet); }
.choice small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.field { display: block; min-width: 0; margin: 0 0 15px; font-weight: 650; }
.field span { font-size: .8rem; color: var(--muted); font-weight: 400; margin-left: 4px; }
input:not([type=checkbox], [type=radio]), select, textarea { background: #fdfbff; border: 1px solid #d9cfe7; border-radius: 10px; padding: 11px 12px; min-width: 0; }
.field input, .field select { width: 100%; display: block; margin-top: 7px; font-weight: 400; }
.toggle-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 10px 0 16px; }
input[role=switch] { appearance: none; position: relative; flex: 0 0 auto; width: 42px; height: 24px; border-radius: 20px; background: #a69bb8; margin: 0; cursor: pointer; }
input[role=switch]::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; left: 3px; top: 3px; background: white; }
input[role=switch]:checked { background: var(--violet); }
input[role=switch]:checked::after { left: 21px; }
button, .button-link { display: inline-flex; justify-content: center; align-items: center; text-align: center; gap: 6px; min-height: 43px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none; font-weight: 650; line-height: 1.25; }
button:disabled { opacity: .52; cursor: default; }
.primary { background: var(--violet); color: white; }
.primary:not(:disabled):hover { background: #453489; }
.secondary { background: var(--soft); color: #43328d; }
.secondary:not(:disabled):hover { background: #e5daf8; }
.quiet { border-color: var(--line); color: var(--muted); background: #fcfaff; }
.quiet:not(:disabled):hover { background: var(--soft); }
.full { width: 100%; }
.notice { background: #fff2f0; color: #882f37; border-radius: 8px; padding: 8px 11px; margin: 0 0 10px; font-size: .86rem; }
.center-page { display: grid; place-items: start center; padding: clamp(18px, 8vh, 100px) 16px 36px; }
.single { width: min(100%, 450px); padding: clamp(24px, 6vw, 42px); }
.state-mark { position: relative; width: 43px; height: 37px; border-radius: 13px 13px 13px 3px; background: var(--soft); }
.state-mark::after { position: absolute; content: '···'; inset: 0; display: grid; place-content: center; color: var(--violet); font-weight: 800; letter-spacing: 1px; font-size: 1.7rem; }
.single .state-mark { margin-bottom: 18px; }
.single h1 { font-size: 1.9rem; }
.single p { margin: 12px 0 20px; }
.single .text-link { display: inline-block; margin-top: 19px; }
.browser-tip { margin-top: 17px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.browser-tip p { margin: 0 0 8px; }
.room-page { width: min(1160px, calc(100% - 36px)); margin: 0 auto 24px; display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 16px; }
.conversation { min-width: 0; display: flex; flex-direction: column; overflow: hidden; min-height: 460px; height: clamp(460px, calc(100dvh - 120px), 900px); }
.room-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 16px 19px; }
.room-head h1 { font-size: 1.43rem; margin-bottom: 7px; }
.room-head button { flex: 0 0 auto; }
.room-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.thread { flex: 1 1 auto; min-height: 90px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; padding: 18px 20px; background: #fcfaff; }
.empty { margin: auto; text-align: center; }
.empty .state-mark { margin: 0 auto 13px; }
.empty strong { display: block; margin-bottom: 6px; }
.empty p { font-size: .86rem; }
.message { max-width: min(85%, 560px); align-self: flex-start; }
.message.self { align-self: flex-end; }
.message-meta { color: var(--muted); font-size: .76rem; margin-bottom: 5px; }
.message.self .message-meta { text-align: right; }
.message-body { padding: 9px 13px; background: #efe9f8; border-radius: 5px 14px 14px 14px; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.55; }
.message.self .message-body { background: var(--violet); color: white; border-radius: 14px 5px 14px 14px; }
.composer { padding: 12px 16px; display: flex; align-items: stretch; gap: 9px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: vertical; max-height: 120px; }
.composer button { align-self: stretch; min-width: 72px; }
.voice-panel { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; gap: 8px; border-top: 1px solid var(--line); }
.voice-panel small { color: var(--muted); margin-top: 4px; }
.voice-actions { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.voice-actions .quiet { min-height: 38px; padding: 7px 9px; font-size: .84rem; }
.room-notice { margin: 0 16px 8px; }
.sidebar { padding: 8px 16px; }
details { padding: 13px 0; }
details + details { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; }
summary span { color: var(--muted); font-size: .82rem; font-weight: 500; margin-left: 4px; }
.members { padding: 0; list-style: none; margin: 10px 0; }
.member { min-height: 49px; display: flex; gap: 9px; align-items: center; }
.member .quiet { min-height: 36px; padding: 6px 8px; font-size: .8rem; }
.member-name { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.member-name small { margin-top: 2px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); color: var(--violet); flex: 0 0 auto; }
.invite-form { display: flex; gap: 6px; margin: 10px 0; }
.invite-form select { flex: 1; }
.invite-row { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; }
.invite-row span { flex: 1; color: var(--muted); }
.invite-row button { min-height: 36px; padding: 6px 7px; font-size: .81rem; }
.copy-field { width: 100%; margin: 6px 0; }
.success { display: inline-block; color: var(--green); padding: 4px 0; font-size: .85rem; }
.lock-button { margin-top: 6px; }
.admin-page { width: min(700px, calc(100% - 32px)); margin: 18px auto 40px; }
.admin { padding: clamp(17px, 5vw, 36px); }
.admin h1 { font-size: 1.8rem; margin: 0 0 17px; }
.admin h2 { font-size: 1.1rem; margin: 12px 0; }
.admin-login { max-width: 420px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 13px; }
.admin-room { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.admin-room small { margin-top: 4px; }
.admin-room button { flex: 0 0 auto; }
@media (max-width: 790px) {
  .topbar { padding-block: 14px; }
  .welcome { grid-template-columns: 1fr; width: min(520px, calc(100% - 30px)); margin: 4px auto 28px; gap: 20px; }
  .intro h1 { font-size: clamp(2rem, 7vw, 3rem); }
  .intro > p { margin: 10px 0 12px; }
  .art { height: 104px; margin-bottom: 12px; transform: scale(.76); transform-origin: top left; overflow: visible; }
  .room-page { grid-template-columns: 1fr; width: min(540px, calc(100% - 20px)); gap: 10px; }
  .conversation { height: calc(100dvh - 84px); min-height: 410px; border-radius: 15px; }
  .room-head { padding: 11px 12px; }
  .room-head button { font-size: .82rem; padding-inline: 8px; }
  .room-status { font-size: .76rem; }
  .thread { padding: 12px; }
  .composer { padding: 8px 9px max(8px, env(safe-area-inset-bottom)); }
  .voice-panel { padding-inline: 9px; }
}
@media (max-width: 360px) {
  .setup { padding: 16px; }
  .choice { gap: 5px; padding-inline: 5px; }
  .choices, .fields { gap: 6px; }
}
