:root {
  --blue: #1e5bd8;
  --blue-dark: #153f99;
  --red: #e0453a;
  --bg: #eef4ff;
  --card: #ffffff;
  --text: #1c2433;
  --muted: #5b6577;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  display: flex; flex-direction: column;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
header {
  background: var(--blue); color: #fff;
  font-size: 22px; font-weight: 700; letter-spacing: 2px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
/* D-047 奏大头像:静态图;说话时切口型视频 + 呼吸光 */
.ava { position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none;
       border: 3px solid #fff; background: #fff; }
.ava img, .ava video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ava video { opacity: 0; transition: opacity .15s; }
.ava.talking video { opacity: 1; }
.ava.talking { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.75); } 50% { box-shadow: 0 0 0 9px rgba(255,255,255,0); } }
header .dots i { background: #fff; }
main { flex: 1; display: flex; flex-direction: column; padding: 16px; min-height: 0; }
main[hidden] { display: none; }
.hint { text-align: center; color: var(--muted); font-size: 18px; margin: 24px 0 12px; }
.big { text-align: center; font-size: 72px; margin: 40px 0 0; }
.err { text-align: center; color: var(--red); }

/* 登录:见 pinpad.css(D-053 手机解锁式) */

#chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.bubble { max-width: 82%; padding: 12px 14px; border-radius: 16px; font-size: 20px; line-height: 1.5; }
.bubble.me { align-self: flex-end; background: #d7e5ff; }
.bubble.kanata { align-self: flex-start; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.bubble.wait { color: var(--muted); }

#photoReady { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 8px; margin-bottom: 10px; }
#photoReady[hidden] { display: none; }
#photoReady img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

.controls { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: env(safe-area-inset-bottom); }
#talkBtn {
  width: min(21vw, 87px); aspect-ratio: 1; border-radius: 50%;   /* 用户 2026-10-11:缩到原来(min(62vw,260px))的 1/3 */
  border: 0; background: var(--blue); color: #fff; font-size: 16px; font-weight: 700; padding: 0; line-height: 1.2;
  box-shadow: 0 3px 0 var(--blue-dark);
  touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
#talkBtn.rec { background: var(--red); box-shadow: 0 1px 0 #9e2c24; transform: translateY(2px); }
#talkBtn:disabled { background: #9fb0d0; box-shadow: none; }
#photoBtn {
  font-size: 18px; color: var(--blue); background: var(--card); border: 2px solid var(--blue);
  border-radius: 999px; padding: 8px 18px;
}

/* 平板横屏:对话在左,按钮在右 */
@media (min-width: 900px) and (orientation: landscape) {
  #talk { flex-direction: row; gap: 24px; }
  #chat { flex: 1; }
  .controls { width: 320px; justify-content: center; }
}

/* D-046:等待动画——三个跳动的小点 */
.dots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); opacity: .3; animation: hop 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 100% { transform: translateY(0); opacity: .3; } 40% { transform: translateY(-5px); opacity: 1; } }
.dots[hidden] { display: none; }
