:root {
  --title: #102f63;
  --ink: #1c3c63;
  --muted: #456788;
  --blue: #1e6fe8;
  --line: rgba(255, 255, 255, .92);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow: hidden; background: #d9ebfb; }
button, input { font: inherit; }
button { color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 3px solid #1e6fe8; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
svg { display: block; width: 1em; height: 1em; }

.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  overflow: hidden;
  padding: 34px 48px 48px;
  background: url("assets/bg-ioc.jpg") center / cover no-repeat,
    radial-gradient(ellipse at 90% 44%, #d8f0ff 0, transparent 56%),
    radial-gradient(ellipse at 20% 0%, #f0fbff 0, transparent 68%),
    linear-gradient(144deg, #c4e2fa 0%, #d8eaff 49%, #a8d3f5 100%);
}
.glass {
  background: linear-gradient(150deg, rgba(255,255,255,.83), rgba(243,250,255,.64));
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: 0 14px 38px rgba(27,92,168,.10), inset 0 1px 0 rgba(255,255,255,.7);
  backdrop-filter: blur(16px);
}
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px 0 36px; }
.brand { display: flex; align-items: center; gap: 25px; color: var(--title); }
.brand strong { font-size: 34px; font-weight: 750; letter-spacing: .09em; }
.brand i { height: 34px; width: 1px; background: #90b4df; }
.brand h1 { font-size: 31px; font-weight: 650; letter-spacing: .045em; }
.icon-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: #215eaf;
  background: rgba(224,239,255,.88);
  font-size: 29px;
}
.icon-button:hover { background: #d5e8ff; }
.icon-button[aria-pressed="true"] { color: #4e6584; background: #deebf7; }

.workspace { display: grid; grid-template-columns: 350px minmax(0,1fr) 495px; gap: 25px; height: 880px; margin-top: 29px; }
.capabilities { padding: 27px 23px; display: flex; flex-direction: column; min-width: 0; }
.capabilities h2, .interaction h2 { color: var(--title); font-size: 29px; font-weight: 750; }
.capabilities h2, .audience { padding-left: 7px; }
.audience { margin-top: 7px; font-size: 19px; color: var(--muted); }
.cards { margin-top: 24px; display: grid; gap: 16px; }
.capability {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 118px;
  padding: 15px 11px 15px 13px;
  text-align: left;
  border: 1px solid #fff;
  border-radius: 22px;
  background: linear-gradient(145deg,#f6fbff,#e3f1ff);
  box-shadow: 0 5px 12px rgba(40,98,169,.08);
}
.capability:hover { background: #f9fcff; box-shadow: 0 5px 16px rgba(40,98,169,.16); }
.capability:active { transform: translateY(2px); }
.capability-icon, .section-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(155deg,#59b6ff,#216ed6);
  box-shadow: inset 0 1px 1px #a9d9ff, 0 4px 9px #307bc336;
  font-size: 37px;
}
.capability-copy { min-width: 0; flex: 1; }
.capability-copy strong { display: block; font-size: 24px; color: #143e77; }
.capability-copy small { display: block; margin-top: 6px; font-size: 16px; line-height: 1.5; color: var(--muted); }
.capability-arrow { color: var(--blue); font-size: 19px; }
.utilities { display: flex; justify-content: center; gap: 19px; margin-top: auto; }
.utilities button { background: transparent; color: #285a94; padding: 12px 3px; font-size: 18px; }
.utilities button:hover { text-decoration: underline; }

.interaction { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 25px; }
.interaction-head { display: flex; gap: 15px; align-items: center; margin-bottom: 20px; }
.section-icon { width: 42px; height: 42px; font-size: 28px; border-radius: 13px; }
.conversation {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #9cc4ec transparent;
  padding: 23px 20px;
  border-radius: 23px;
  border: 1px solid rgba(255,255,255,.9);
  background: rgba(238,248,255,.54);
}
.message { display: flex; align-items: flex-start; gap: 12px; flex: 0 0 auto; }
.user-message { flex-direction: row-reverse; }
.message-icon { display: grid; place-items: center; flex: none; width: 43px; height: 43px; border-radius: 50%; overflow: hidden; background: #d9ecff; color: #2674cd; font-size: 25px; }
.message-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.message-content { min-width: 0; max-width: calc(100% - 55px); padding: 15px 19px; border-radius: 6px 20px 20px 20px; background: #fff; border: 1px solid #fafdff; box-shadow: 0 4px 12px #23568b13; }
.user-message .message-content { color: #123e79; background: #d9ebff; border-color: #e8f4ff; border-radius: 20px 6px 20px 20px; }
.message-text { font-size: 21px; line-height: 1.55; overflow-wrap: anywhere; }
.message-text + .dh-display { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e1ebf7; }
.message-content .dh-display { font-size: 18px; overflow-wrap: anywhere; }
.message-content .dh-md p:last-child, .message-content .dh-md-table:last-child { margin-bottom: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0 0; }
.chips:empty { display: none; }
.chip { border: 1px solid #c7def7; border-radius: 20px; background: #f5faff; padding: 7px 14px; color: #215caa; font-size: 17px; }
.chip:hover { background: #e1efff; }
.composer { margin-top: 14px; }
.text-form, .voice-bar { display: flex; align-items: center; min-height: 64px; gap: 12px; }
.input-group { display: flex; align-items: center; flex: 1; min-width: 0; background: #f7fbff; border: 1px solid #d0e1f5; border-radius: 20px; padding: 2px; }
.input-group input { flex: 1; min-width: 0; height: 55px; border: 0; background: transparent; color: var(--title); border-radius: 18px; padding: 0 18px; font-size: 22px; }
.input-group input::placeholder { color: #587391; }
.mic-btn { position: relative; width: 52px; height: 52px; background: transparent; }
#dockLive { position: absolute; right: 7px; top: 7px; width: 8px; height: 8px; background: #15906c; border-radius: 50%; }
.btn { height: 53px; padding: 0 20px; border-radius: 17px; font-size: 19px; font-weight: 650; flex: none; white-space: nowrap; }
.btn.primary { color: #fff; background: linear-gradient(150deg,#3e94fa,#195ecc); box-shadow: 0 5px 13px #246fd43b; }
.btn.primary:hover { background: #1d65d3; }
.btn.ghost { color: #1c559d; background: #e5f1fe; }
.btn.ghost:hover { background: #d6e9fd; }
.btn:active { transform: translateY(2px); }
.send { display: flex; gap: 9px; align-items: center; height: 57px; padding-inline: 22px; }
.voice-bar { gap: 10px; }
.voice-orb { flex: none; display: grid; place-items: center; width: 49px; height: 49px; border-radius: 50%; background: var(--blue); color: white; font-size: 25px; box-shadow: 0 0 0 calc(var(--level, 0) * 12px) #2f8ff448; }
.voice-text { min-width: 0; flex: 1; font-size: 17px; }
.voice-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 15px; }
.voice-wave { display: flex; align-items: center; gap: 3px; height: 60px; }
.voice-wave i { width: 4px; height: 8px; background: #2f8ff4; border-radius: 5px; transition: height .09s linear; }
.switch { display: flex; align-items: center; gap: 5px; font-size: 16px; white-space: nowrap; }
.switch input { width: 16px; height: 16px; accent-color: var(--blue); }

.assistant { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; min-height: 0; }
.assistant-head { display: flex; align-items: baseline; gap: 12px; color: var(--title); padding: 18px 0 9px; }
.assistant-head strong { font-size: 30px; font-weight: 750; }
.assistant-head span { font-size: 18px; color: #33587d; }
.avatar-area { position: relative; flex: 1; width: 100%; min-height: 0; display: grid; place-items: center; }
.avatar-halo { position: absolute; width: 405px; aspect-ratio: 1; border-radius: 50%; border: 1px solid #ffffffab; box-shadow: 0 0 0 23px #ffffff26, 0 0 0 45px #ffffff16; background: radial-gradient(#f9fdffb3,#e6f5ff66 73%,transparent); }
.avatar { position: relative; width: 100%; height: 100%; }
.avatar[data-background="scene"] { width: 88%; height: 94%; border-radius: 34px; overflow: hidden; }
.has-video .avatar[data-background="scene"] { border: 1px solid #fff; box-shadow: 0 12px 30px #2b609532; background: #e4f1fc; }
.talk { min-height: 102px; width: 100%; padding: 10px 11px 12px; position: relative; display: flex; align-items: center; justify-content: center; }
.bubble { max-width: 100%; border: 1px solid var(--line); border-radius: 20px; color: #194779; background: #f5fbffed; padding: 12px 19px; font-size: 20px; line-height: 1.45; text-align: center; white-space: pre-line; box-shadow: 0 5px 17px #3974b71b; }
.bubble.is-long { font-size: 17px; }
.bubble[data-mode="speaking"] { border-color: #99caff; }
#stopBtn { display: flex; align-items: center; justify-content: center; gap: 7px; position: absolute; right: 11px; bottom: calc(100% + 9px); box-shadow: 0 4px 16px #12335e2c; }
.state-strip { display: flex; align-items: center; justify-content: space-between; padding: 7px; gap: 4px; width: 100%; border-radius: 24px; }
.state-chip { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-width: 0; padding: 10px 4px; border-radius: 17px; font-size: 19px; color: #3d648e; white-space: nowrap; }
.state-chip svg { color: #3579be; font-size: 23px; }
.state-chip[aria-current="true"] { background: #206fde; color: #fff; box-shadow: 0 3px 8px #2e76d845; }
.state-chip[aria-current="true"] svg { color: #fff; }

#guide { width: 670px; padding: 28px; color: var(--ink); }
#guide::backdrop { background: #14315c60; }
#guide header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
#guide h3 { margin-top: 15px; font-size: 19px; }
#guide p { margin-top: 4px; color: var(--muted); font-size: 17px; }
#guide .chip { margin: 5px; }
/* ------------------------------------------------------------------ status: network pill, toast, overlays */
.net-pill { position: absolute; left: 50%; top: 108px; transform: translateX(-50%); z-index: 60; height: 56px; padding: 0 28px 0 20px; border-radius: 28px; display: flex; align-items: center; gap: 14px;
  font-size: 22px; color: #fff; background: rgba(214,120,30,.95); box-shadow: 0 10px 26px rgba(150,80,10,.35); animation: swap .25s ease; white-space: nowrap; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .9s linear infinite; }
.spinner.big { width: 64px; height: 64px; border-width: 6px; border-color: rgba(47,121,214,.22); border-top-color: #2f79d6; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: absolute; left: 50%; top: 440px; transform: translateX(-50%); z-index: 70; max-width: 900px; padding: 18px 36px; border-radius: 20px; font-size: 26px; line-height: 38px; color: #fff; text-align: center;
  background: rgba(12,38,84,.9); box-shadow: 0 14px 34px rgba(0,20,60,.35); animation: swap .22s ease; }

.overlay { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; }
.overlay-queue { background: rgba(214,233,250,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.overlay-card { min-width: 640px; padding: 46px 60px 42px; border-radius: 34px; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: linear-gradient(140deg, rgba(255,255,255,.98), rgba(232,243,254,.96)); border: 1.5px solid #fff; box-shadow: 0 24px 60px rgba(40,95,175,.34); }
.overlay-title { margin-top: 26px; font-size: 36px; line-height: 48px; font-weight: 700; color: var(--title); letter-spacing: 1px; }
.overlay-sub { margin-top: 10px; font-size: 25px; line-height: 36px; color: #4c5c76; min-height: 36px; }

.overlay-start { z-index: 80; cursor: pointer; background: radial-gradient(ellipse at 62% 55%, rgba(18,64,132,.34), rgba(10,40,96,.62)); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); transition: opacity .35s ease; }
.overlay-start.is-leaving { opacity: 0; pointer-events: none; }
.start-inner { display: flex; flex-direction: column; align-items: center; color: #fff; text-align: center; text-shadow: 0 3px 14px rgba(0,20,70,.5); }
.start-ring { position: relative; width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(150deg, rgba(120,180,250,.95), rgba(31,98,198,.95)); box-shadow: 0 16px 40px rgba(0,30,90,.45), inset 0 3px 8px rgba(255,255,255,.4); }
.start-ring::before, .start-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(255,255,255,.7); animation: ring 2.2s infinite ease-out; }
.start-ring::after { animation-delay: 1.1s; }
.start-ring svg { width: 92px; height: 92px; }
.start-title { margin-top: 44px; font-size: 64px; line-height: 80px; font-weight: 800; letter-spacing: 8px; }
.start-sub { margin-top: 10px; font-size: 30px; line-height: 42px; letter-spacing: 3px; opacity: .92; min-height: 42px; }
.overlay-start.is-error .start-ring { background: linear-gradient(150deg, #f0a25a, #d6781e); }
.overlay-start.is-busy { cursor: default; }
.overlay-start.is-busy .start-ring svg { animation: spin 1.2s linear infinite; }

.debug-log { position: absolute; right: 12px; top: 104px; z-index: 90; width: 520px; max-height: 300px; margin: 0; padding: 8px 10px; overflow: hidden; border-radius: 8px; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; color: #c9f7d2; background: rgba(0,20,40,.78); pointer-events: none; white-space: pre-wrap; word-break: break-all; }

/* technical reason of a failed connection: small, for support */
.start-err { margin-top: 18px; max-width: 1200px; font-size: 20px; line-height: 28px; color: rgba(255,255,255,.82); font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; text-align: center; }

/* visitor password */
.overlay-login { z-index: 90; }
.login-input { margin-top: 26px; width: 520px; height: 74px; padding: 0 26px; border-radius: 20px; border: 2px solid #b9d5f6; background: #fff; font-size: 32px; letter-spacing: 6px; text-align: center; color: var(--title); outline: none; }
.login-input:focus { border-color: #2a73c8; box-shadow: 0 0 0 5px rgba(42,115,200,.16); }
.login-err { min-height: 34px; margin: 12px 0 14px; font-size: 22px; line-height: 34px; color: #c2410c; }
@keyframes ring { from { transform: scale(.94); opacity: .78; } to { transform: scale(1.38); opacity: 0; } }
@keyframes swap { from { opacity: 0; } to { opacity: 1; } }

/* ICP filing number: always visible at the bottom centre, above every overlay */
.icp { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 95; font-size: 15px; line-height: 22px; padding: 0 12px; border-radius: 11px;
  color: rgba(40,62,98,.78); background: rgba(255,255,255,.42); text-decoration: none; letter-spacing: .5px; }
.icp:hover { color: #1e6fe8; text-decoration: underline; }
