* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1f1a17; color: #f3ece4; font: 16px/1.5 -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }
.card { margin: auto; text-align: center; padding: 24px; width: 100%; max-width: 360px; }
.title { font-size: 22px; margin: 12px 0 4px; }
.sub { color: #b8aa9b; }
.small { font-size: 13px; }
.err { color: #ff9b8a; min-height: 1.5em; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #3a312b; }
.avatar.big { width: 112px; height: 112px; box-shadow: 0 0 0 4px #c8a27c33; }
#loginForm { display: flex; gap: 8px; margin-top: 16px; }
input, textarea { flex: 1; min-width: 0; font: inherit; color: inherit; background: #2c2521; border: 1px solid #4a3f37; border-radius: 12px; padding: 10px 12px; outline: none; }
input:focus, textarea:focus { border-color: #c8a27c; }
#loginForm button, #typeForm button { border: 0; border-radius: 12px; padding: 0 16px; background: #c8a27c; color: #1f1a17; }

.round { width: 64px; height: 64px; border-radius: 50%; border: 0; font-size: 26px; background: #3a312b; color: #f3ece4; display: inline-flex; align-items: center; justify-content: center; }
.round.off { background: #f3ece4; color: #1f1a17; position: relative; }
.round.off::after { content: ""; position: absolute; width: 44px; height: 3px; background: #d9534f; transform: rotate(-45deg); border-radius: 2px; }
.round.green { background: #3fae5a; margin: 28px 0 16px; width: 76px; height: 76px; font-size: 32px; }
.round.red { background: #d9534f; }

#incall header { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid #2f2824; }
#incall .who { flex: 1; }
#kekeState.on { color: #8fd19e; }
#kekeState.think { color: #c8a27c; }
#self { position: absolute; right: 12px; top: calc(70px + env(safe-area-inset-top)); width: 96px; height: 128px; object-fit: cover; border-radius: 12px; transform: scaleX(-1); background: #000; z-index: 2; box-shadow: 0 2px 10px #0008; }
#log { flex: 1; overflow-y: auto; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; }
.msg.keke { align-self: flex-start; background: #3a312b; border-bottom-left-radius: 4px; }
.msg.xixi { align-self: flex-end; background: #c8a27c; color: #1f1a17; border-bottom-right-radius: 4px; }
.msg.xixi.voice::before { content: "🎙 "; font-size: 12px; }
.msg.system { align-self: center; background: none; color: #8a7d70; font-size: 12px; padding: 0; }
#interim { min-height: 1.5em; padding: 0 16px; font-style: italic; text-align: right; }
#typeForm { display: flex; gap: 8px; padding: 6px 12px; }
#typeBox { resize: none; max-height: 120px; }
.tip { margin: 0; padding: 0 16px; font-size: 13px; color: #ff9b8a; min-height: 0; }
nav { display: flex; justify-content: space-around; padding: 10px 24px calc(14px + env(safe-area-inset-bottom)); }
