:root {
  color: #f5f0f1;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  background: #111927;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #111927;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 420px;
  overflow: hidden;
  background: #111927;
  touch-action: none;
}

#world {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#world.dragging {
  cursor: grabbing;
}

#vignette,
#grain,
.weather-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#vignette {
  background:
    linear-gradient(180deg, rgba(9, 15, 28, 0.1), transparent 32%, transparent 72%, rgba(5, 10, 16, 0.26)),
    radial-gradient(ellipse at center, transparent 45%, rgba(5, 10, 18, 0.34) 112%);
}

#grain {
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.weather-rain {
  inset: -12%;
  opacity: 0;
  background-image:
    repeating-linear-gradient(
      104deg,
      transparent 0 13px,
      rgba(205, 222, 238, 0.22) 14px,
      transparent 15px 31px
    ),
    repeating-linear-gradient(
      104deg,
      transparent 0 27px,
      rgba(194, 214, 233, 0.12) 28px,
      transparent 29px 58px
    );
  background-size: 67px 128px, 119px 196px;
  filter: blur(0.25px);
  transform: translate3d(0, -8%, 0);
  transition: opacity 1.2s ease;
  animation: rainfall 560ms linear infinite;
}

@keyframes rainfall {
  to { transform: translate3d(-18px, 20%, 0); }
}

.entry-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 44%, rgba(26, 39, 55, 0.18), rgba(5, 9, 16, 0.68) 72%),
    linear-gradient(180deg, rgba(4, 10, 18, 0.26), rgba(5, 10, 17, 0.64));
  opacity: 1;
  transition: opacity 900ms ease;
}

.entry-screen.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.entry-screen[hidden] {
  display: none;
}

.entry-copy {
  width: min(420px, calc(100vw - 56px));
  text-align: center;
  text-shadow: 0 2px 24px rgba(1, 5, 11, 0.66);
}

.entry-kicker {
  margin: 0 0 18px;
  color: rgba(232, 235, 243, 0.64);
  font-size: 11px;
  letter-spacing: 0.28em;
}

.entry-copy h2 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
}

.entry-copy p:not(.entry-kicker) {
  margin: 20px 0 30px;
  color: rgba(244, 241, 245, 0.68);
  font-size: 13px;
  letter-spacing: 0.08em;
}

#enterButton {
  min-width: 142px;
  padding: 12px 24px;
  border: 1px solid rgba(238, 232, 237, 0.42);
  border-radius: 999px;
  background: rgba(241, 235, 239, 0.1);
  box-shadow: 0 12px 35px rgba(0, 3, 8, 0.18);
  backdrop-filter: blur(10px);
  color: rgba(255, 252, 252, 0.92);
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: background 220ms ease, border-color 220ms ease, transform 220ms ease;
}

#enterButton:hover:not(:disabled),
#enterButton:focus-visible {
  border-color: rgba(255, 248, 247, 0.72);
  background: rgba(248, 242, 244, 0.17);
  transform: translateY(-1px);
}

#enterButton:disabled {
  cursor: wait;
  opacity: 0.55;
}

.entry-copy small {
  display: block;
  margin-top: 18px;
  color: rgba(234, 232, 239, 0.46);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.registration-copy {
  width: min(470px, calc(100vw - 48px));
}

.registration-form {
  margin-top: 30px;
  text-align: left;
}

.registration-form label {
  display: block;
  margin: 0 0 8px 4px;
  color: rgba(239, 235, 241, 0.62);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.registration-row {
  display: flex;
  gap: 9px;
}

#registrationName {
  min-width: 0;
  flex: 1;
  padding: 13px 15px;
  border: 1px solid rgba(239, 234, 239, 0.26);
  border-radius: 999px;
  outline: none;
  background: rgba(13, 21, 33, 0.44);
  backdrop-filter: blur(12px);
  color: rgba(255, 252, 252, 0.94);
  letter-spacing: 0.05em;
}

#registrationName:focus {
  border-color: rgba(246, 205, 193, 0.62);
}

#registrationName::placeholder {
  color: rgba(238, 235, 241, 0.34);
}

#registerButton {
  flex: 0 0 auto;
  padding: 0 22px;
  border: 1px solid rgba(244, 220, 211, 0.42);
  border-radius: 999px;
  background: rgba(106, 72, 62, 0.4);
  color: rgba(255, 249, 246, 0.94);
  cursor: pointer;
}

#registerButton:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.quick-enter-wrap {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.quick-enter-divider {
  color: rgba(234, 232, 239, 0.44);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.quick-enter-btn {
  padding: 10px 26px;
  border: 1px solid rgba(246, 209, 179, 0.46);
  border-radius: 999px;
  background: rgba(246, 209, 179, 0.14);
  backdrop-filter: blur(10px);
  color: rgba(255, 248, 240, 0.96);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.quick-enter-btn:hover:not(:disabled),
.quick-enter-btn:focus-visible {
  background: rgba(246, 209, 179, 0.24);
  border-color: rgba(255, 224, 198, 0.78);
  transform: translateY(-1px);
}

.quick-enter-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.lang-toggle {
  position: absolute;
  top: clamp(18px, 2.6vw, 34px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  padding: 5px 13px;
  border: 1px solid rgba(244, 236, 232, 0.26);
  border-radius: 999px;
  background: rgba(14, 22, 34, 0.68);
  color: rgba(246, 240, 236, 0.9);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  pointer-events: auto;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  background: rgba(246, 214, 188, 0.18);
  border-color: rgba(246, 214, 188, 0.56);
  color: #fffaf5;
}

body.capture .lang-toggle {
  display: none;
}

html[lang="en"] h1,
html[lang="en"] .entry-copy h2,
html[lang="en"] .character-copy h2 {
  font-family: "Georgia", "Times New Roman", "STSong", serif;
  letter-spacing: 0.06em;
  text-indent: 0;
}

.character-screen {
  position: absolute;
  inset: 0;
  z-index: 19;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.8vh, 30px);
  padding: clamp(24px, 5vh, 54px) 24px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 38%, rgba(83, 60, 50, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(6, 12, 21, 0.72), rgba(5, 10, 17, 0.9));
  opacity: 1;
  transition: opacity 700ms ease;
}

.character-screen.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.character-screen[hidden] {
  display: none;
}

.character-copy {
  max-width: 620px;
  text-align: center;
  text-shadow: 0 2px 24px rgba(1, 5, 11, 0.66);
}

.character-copy h2 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}

.character-copy > p:last-child {
  margin: 13px 0 0;
  color: rgba(242, 238, 241, 0.58);
  font-size: 12px;
  line-height: 1.7;
}

.character-main {
  display: grid;
  width: min(980px, 92vw);
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 38px);
}

.character-stage {
  position: relative;
  width: 100%;
  height: min(54vh, 440px);
  min-height: 320px;
  overflow: hidden;
  border: 1px solid rgba(245, 224, 214, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 72%, rgba(193, 126, 83, 0.2), transparent 44%),
    linear-gradient(180deg, rgba(31, 48, 65, 0.42), rgba(13, 20, 28, 0.68));
  box-shadow: inset 0 0 60px rgba(5, 9, 14, 0.24);
}

.character-stage::after {
  position: absolute;
  right: 22%;
  bottom: 18px;
  left: 22%;
  height: 16px;
  border-radius: 50%;
  background: rgba(2, 5, 8, 0.34);
  filter: blur(6px);
  content: "";
}

#characterPreviewCanvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

.character-stage p {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  z-index: 2;
  margin: 0;
  color: rgba(245, 237, 233, 0.58);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-align: center;
  pointer-events: none;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 15px);
}

.character-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px 10px 10px;
  border: 1px solid rgba(233, 230, 236, 0.18);
  border-radius: 16px;
  background: rgba(18, 27, 40, 0.58);
  backdrop-filter: blur(14px);
  color: rgba(250, 247, 249, 0.84);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.character-card:hover,
.character-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(249, 221, 209, 0.46);
  background: rgba(31, 39, 49, 0.72);
}

.character-card.is-selected {
  border-color: rgba(255, 216, 196, 0.76);
  background: rgba(91, 60, 51, 0.56);
  box-shadow: 0 12px 36px rgba(15, 6, 3, 0.24);
}

.character-card img {
  width: 72px;
  height: 82px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(5, 10, 17, 0.4);
}

.character-card strong,
.character-card span {
  display: block;
}

.character-card strong {
  margin-bottom: 5px;
  font-family: "STSong", "SimSun", serif;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.character-card span {
  color: rgba(236, 232, 236, 0.46);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.character-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.character-back {
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: rgba(236, 232, 237, 0.5);
  font-size: 11px;
  cursor: pointer;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(20px, 3vw, 42px) clamp(22px, 4vw, 60px);
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(4, 10, 18, 0.55);
}

.eyebrow {
  margin: 0 0 7px;
  font-size: 10px;
  letter-spacing: 0.27em;
  color: rgba(239, 235, 243, 0.68);
}

h1 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(21px, 2.2vw, 34px);
  font-weight: 400;
  letter-spacing: 0.13em;
}

.conditions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  font-size: 12px;
  color: rgba(242, 239, 243, 0.72);
}

.conditions strong {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255, 252, 252, 0.92);
}

.demo-badge {
  position: absolute;
  top: clamp(82px, 10vh, 108px);
  right: clamp(20px, 3vw, 42px);
  padding: 8px 13px;
  border: 1px solid rgba(255, 239, 241, 0.32);
  border-radius: 999px;
  background: rgba(19, 24, 39, 0.42);
  backdrop-filter: blur(8px);
  color: rgba(255, 243, 244, 0.92);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.sit-prompt {
  position: absolute;
  left: 50%;
  bottom: 98px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(244, 215, 202, 0.3);
  border-radius: 999px;
  background: rgba(16, 23, 35, 0.76);
  color: rgba(244, 239, 234, 0.92);
  font-size: 12px;
  letter-spacing: 0.06em;
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 260ms ease, border-color 200ms ease, background 200ms ease, transform 220ms ease;
}

.sit-prompt[hidden] {
  display: none;
}

.sit-prompt:hover {
  border-color: rgba(244, 215, 202, 0.54);
  background: rgba(24, 34, 49, 0.72);
  transform: translateX(-50%) translateY(-1px);
}

.sit-prompt.is-seated {
  opacity: 0.68;
  border-color: rgba(239, 239, 244, 0.16);
  background: rgba(14, 20, 31, 0.42);
}

.sit-prompt.is-seated:hover {
  opacity: 1;
}

.sit-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid rgba(244, 215, 202, 0.35);
  background: rgba(244, 215, 202, 0.14);
  color: #f6dfce;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.audio-visualizer {
  position: absolute;
  left: 50%;
  bottom: 50px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
  transform: translateX(-50%);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease, transform 200ms ease;
}

body.entered .audio-visualizer.is-playing {
  opacity: 0.92;
  pointer-events: auto;
}

body.entered .audio-visualizer.is-playing:hover {
  opacity: 1;
  transform: translateX(-50%) scale(1.03);
}

#audioVisualizer {
  display: block;
  width: 224px;
  height: 28px;
}

.look-hint {
  position: absolute;
  left: 50%;
  bottom: 27px;
  display: flex;
  align-items: center;
  gap: 11px;
  transform: translateX(-50%);
  color: rgba(239, 239, 244, 0.55);
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.look-hint i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
}

.people-panel {
  position: absolute;
  top: clamp(92px, 13vh, 126px);
  right: clamp(18px, 3vw, 42px);
  z-index: 5;
  width: min(218px, 28vw);
  max-height: min(46vh, 390px);
  padding: 10px;
  border: 1px solid rgba(234, 230, 237, 0.16);
  border-radius: 15px;
  background: rgba(12, 20, 31, 0.72);
  box-shadow: 0 20px 55px rgba(3, 8, 14, 0.18);
  transition: padding 220ms ease, border-radius 220ms ease, width 220ms ease, background 200ms ease;
}

.people-panel[hidden] {
  display: none;
}

.people-panel.is-collapsed {
  width: auto;
  min-width: 136px;
  padding: 7px 13px;
  border-radius: 999px;
}

.people-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 1px 3px 9px;
  border: 0;
  background: transparent;
  color: rgba(239, 235, 240, 0.58);
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-align: left;
  transition: color 180ms ease;
}

.people-head:hover {
  color: rgba(255, 245, 240, 0.9);
}

.people-panel.is-collapsed .people-head {
  padding: 0;
}

.people-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.people-head strong {
  font-weight: 400;
  color: rgba(255, 244, 239, 0.78);
}

.people-caret {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  color: rgba(244, 224, 214, 0.65);
  transition: transform 200ms ease;
}

.people-panel.is-collapsed .people-caret {
  transform: rotate(-90deg);
}

.people-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(min(46vh, 390px) - 42px);
  overflow: auto;
}

.people-panel.is-collapsed .people-list {
  display: none;
}

.person-card {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(250, 247, 249, 0.78);
  text-align: left;
  cursor: pointer;
}

.person-card:hover,
.person-card:focus-visible,
.person-card.is-chatting {
  border-color: rgba(244, 215, 205, 0.28);
  background: rgba(239, 220, 214, 0.08);
}

.person-card img {
  width: 34px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
}

.person-card strong,
.person-card span {
  display: block;
  min-width: 0;
}

.person-card strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-card span {
  margin-top: 2px;
  color: rgba(234, 231, 235, 0.38);
  font-size: 9px;
}

.talk {
  position: absolute;
  left: clamp(20px, 3vw, 42px);
  bottom: clamp(20px, 3vw, 38px);
  width: min(340px, calc(100vw - 40px));
}

#talkToggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(231, 230, 239, 0.24);
  border-radius: 999px;
  background: rgba(14, 22, 35, 0.68);
  font-size: 12px;
  cursor: pointer;
}

.talk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d9c1c8;
  box-shadow: 0 0 12px rgba(247, 201, 213, 0.8);
}

.talk-panel {
  width: 100%;
  margin-top: 9px;
  padding: 12px;
  border: 1px solid rgba(232, 232, 239, 0.18);
  border-radius: 14px;
  background: rgba(12, 20, 32, 0.66);
  box-shadow: 0 20px 60px rgba(3, 8, 15, 0.2);
  backdrop-filter: blur(16px);
}

.talk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: rgba(239, 237, 243, 0.52);
  font-size: 10px;
}

.talk-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.talk-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(235, 232, 240, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(244, 238, 240, 0.72);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.talk-close:hover {
  border-color: rgba(246, 206, 174, 0.48);
  background: rgba(246, 206, 174, 0.16);
  color: #fff6f0;
}

.chat-target-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-target-bar::-webkit-scrollbar {
  display: none;
}

.chat-target-pill {
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid rgba(235, 232, 240, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(242, 238, 244, 0.72);
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.chat-target-pill:hover {
  border-color: rgba(244, 215, 196, 0.42);
  color: #fff6f0;
}

.chat-target-pill.is-active {
  border-color: rgba(246, 206, 174, 0.62);
  background: rgba(246, 206, 174, 0.18);
  color: #fde4cc;
}

.chat-with {
  margin: 0 0 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(234, 231, 237, 0.1);
  color: rgba(244, 211, 201, 0.68);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 130px;
  margin-bottom: 9px;
  overflow: auto;
}

.message {
  margin: 0;
  color: rgba(250, 247, 249, 0.87);
  font-size: 12px;
  line-height: 1.55;
  animation: message-in 240ms ease both;
}

.message.is-mentioned-me {
  padding-left: 7px;
  border-left: 2px solid rgba(249, 214, 165, 0.78);
}

.message strong {
  margin-right: 7px;
  color: rgba(241, 198, 211, 0.75);
  font-weight: 500;
}

.message-mention {
  color: #f9d6a5;
  font-weight: 500;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.talk-input-wrap {
  position: relative;
}

.mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 7px);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 164px;
  padding: 6px;
  overflow: auto;
  border: 1px solid rgba(244, 218, 200, 0.28);
  border-radius: 11px;
  background: rgba(13, 22, 35, 0.92);
  box-shadow: 0 14px 36px rgba(3, 8, 15, 0.42);
  backdrop-filter: blur(14px);
}

.mention-menu[hidden] {
  display: none;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(248, 244, 246, 0.9);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.mention-item:hover,
.mention-item.is-selected {
  border-color: rgba(246, 206, 174, 0.34);
  background: rgba(246, 206, 174, 0.14);
}

.mention-item img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
}

.mention-item strong {
  font-weight: 500;
  color: #fce2c7;
}

.mention-item span {
  margin-left: auto;
  font-size: 10px;
  color: rgba(235, 231, 238, 0.48);
}

#talkForm {
  display: flex;
  gap: 8px;
}

#talkInput {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  border: 1px solid rgba(230, 231, 239, 0.14);
  border-radius: 8px;
  outline: none;
  background: rgba(247, 243, 247, 0.06);
  color: #f8f5f7;
  font-size: 12px;
}

#talkInput:focus {
  border-color: rgba(233, 202, 212, 0.44);
}

#talkForm button {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(231, 209, 216, 0.14);
  cursor: pointer;
}

.music-panel {
  position: absolute;
  right: clamp(20px, 3vw, 42px);
  bottom: calc(clamp(20px, 3vw, 38px) + 50px);
  z-index: 6;
  width: min(332px, calc(100vw - 36px));
  padding: 13px 13px 11px;
  border: 1px solid rgba(234, 230, 237, 0.2);
  border-radius: 16px;
  background: rgba(12, 20, 32, 0.76);
  box-shadow: 0 22px 64px rgba(3, 8, 15, 0.34);
  backdrop-filter: blur(18px);
  color: rgba(250, 247, 249, 0.88);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.music-panel[hidden] {
  display: none;
}

.music-panel.is-dragover {
  border-color: rgba(244, 211, 195, 0.78);
  box-shadow: 0 0 0 1px rgba(244, 211, 195, 0.36), 0 22px 64px rgba(3, 8, 15, 0.42);
}

.music-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.music-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 250, 248, 0.06);
  border: 1px solid rgba(235, 231, 238, 0.12);
}

.music-tab {
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(238, 234, 240, 0.56);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.music-tab.is-active {
  background: rgba(234, 203, 190, 0.2);
  color: rgba(255, 248, 244, 0.96);
}

.music-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(238, 234, 240, 0.52);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.music-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 250, 248, 0.92);
}

.music-now {
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 249, 246, 0.05);
  border: 1px solid rgba(236, 231, 238, 0.1);
  margin-bottom: 10px;
}

.music-now-meta strong {
  display: block;
  font-family: "STSong", "SimSun", serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.07em;
  color: rgba(255, 250, 247, 0.95);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-now-meta span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: rgba(236, 230, 236, 0.54);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 9px;
  font-size: 10px;
  color: rgba(236, 232, 238, 0.54);
  font-variant-numeric: tabular-nums;
}

.music-progress-row input[type="range"],
.music-volume input[type="range"] {
  accent-color: #e5c7ba;
  cursor: pointer;
}

#musicSeek {
  flex: 1;
  min-width: 0;
  height: 3px;
}

.music-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.music-ctrl-subtle {
  padding: 4px 8px;
  border: 1px solid rgba(235, 231, 238, 0.14);
  border-radius: 999px;
  background: transparent;
  color: rgba(238, 234, 240, 0.66);
  font-size: 10px;
  cursor: pointer;
}

.music-ctrl-subtle:hover {
  border-color: rgba(244, 215, 205, 0.42);
  color: rgba(255, 249, 246, 0.95);
}

.music-transport {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.music-icon-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(235, 231, 238, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(250, 246, 248, 0.86);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.music-play-btn {
  min-width: 54px;
  padding: 5px 12px;
  border: 1px solid rgba(242, 211, 198, 0.44);
  border-radius: 999px;
  background: rgba(114, 79, 68, 0.48);
  color: rgba(255, 249, 245, 0.96);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.music-icon-btn:hover,
.music-play-btn:hover {
  border-color: rgba(250, 224, 212, 0.72);
  background: rgba(132, 92, 79, 0.62);
}

.music-volume {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: rgba(236, 232, 238, 0.56);
}

#musicVolume {
  width: 56px;
  height: 3px;
}

.music-pane[hidden] {
  display: none;
}

.music-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 204px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(235, 215, 206, 0.28) transparent;
}

.music-list::-webkit-scrollbar {
  width: 4px;
}

.music-list::-webkit-scrollbar-track {
  background: transparent;
}

.music-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(235, 215, 206, 0.28);
}

.music-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(248, 245, 248, 0.8);
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.music-item:hover {
  background: rgba(255, 248, 245, 0.06);
}

.music-item.is-active {
  border-color: rgba(242, 211, 198, 0.36);
  background: rgba(235, 204, 192, 0.12);
  color: rgba(255, 250, 247, 0.98);
}

.music-item-main {
  min-width: 0;
  flex: 1;
}

.music-item-main strong {
  display: block;
  font-size: 12px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-item-main span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: rgba(234, 230, 236, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-item-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 10px;
  color: rgba(234, 230, 236, 0.48);
  font-variant-numeric: tabular-nums;
}

.music-item-remove {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(238, 234, 240, 0.48);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.music-item-remove:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.music-local-drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  margin-bottom: 8px;
  border: 1px dashed rgba(238, 212, 200, 0.28);
  border-radius: 11px;
  background: rgba(255, 248, 245, 0.03);
}

.music-local-drop span {
  width: 100%;
  font-size: 10px;
  color: rgba(236, 232, 238, 0.5);
}

.music-pick-btn {
  padding: 6px 12px;
  border: 1px solid rgba(242, 211, 198, 0.48);
  border-radius: 999px;
  background: rgba(114, 79, 68, 0.44);
  color: rgba(255, 249, 245, 0.95);
  font-size: 11px;
  cursor: pointer;
}

.music-pick-btn:hover {
  background: rgba(132, 92, 79, 0.62);
}

.music-clear-btn {
  padding: 5px 10px;
  border: 1px solid rgba(235, 231, 238, 0.16);
  border-radius: 999px;
  background: transparent;
  color: rgba(236, 232, 238, 0.62);
  font-size: 10px;
  cursor: pointer;
}

.music-clear-btn:hover {
  border-color: rgba(244, 215, 205, 0.4);
  color: #fff;
}

.music-empty {
  padding: 16px 8px;
  text-align: center;
  font-size: 11px;
  color: rgba(236, 232, 238, 0.45);
}

.music-tip {
  margin: 8px 2px 0;
  font-size: 9.5px;
  line-height: 1.45;
  color: rgba(236, 232, 238, 0.42);
}

.scene-actions {
  position: absolute;
  right: clamp(20px, 3vw, 42px);
  bottom: clamp(20px, 3vw, 38px);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.view,
.music,
.posture,
.postcard {
  padding: 9px 14px;
  border: 1px solid rgba(231, 230, 239, 0.22);
  border-radius: 999px;
  background: rgba(14, 22, 35, 0.68);
  color: rgba(249, 247, 249, 0.86);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.postcard.is-saved {
  border-color: rgba(246, 206, 152, 0.62);
  background: rgba(74, 54, 42, 0.56);
  color: rgba(255, 246, 234, 0.96);
}

.webview-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 460px);
  padding: 9px 12px 9px 16px;
  border: 1px solid rgba(246, 212, 186, 0.36);
  border-radius: 999px;
  background: rgba(13, 21, 34, 0.88);
  backdrop-filter: blur(14px);
  color: rgba(255, 248, 242, 0.92);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
}

.webview-banner[hidden] {
  display: none;
}

.webview-banner button {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 248, 242, 0.82);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.people-solo-note {
  margin: 6px 2px 2px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 248, 242, 0.04);
  color: rgba(235, 230, 236, 0.58);
  font-size: 10.5px;
  line-height: 1.45;
}

.chat-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-presets[hidden],
.chat-preset-note[hidden],
.talk-input-wrap[hidden] {
  display: none;
}

.chat-preset-btn {
  padding: 6px 10px;
  border: 1px solid rgba(238, 216, 204, 0.24);
  border-radius: 999px;
  background: rgba(255, 248, 244, 0.06);
  color: rgba(252, 248, 246, 0.88);
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 120ms ease;
}

.chat-preset-btn:hover {
  border-color: rgba(246, 212, 186, 0.58);
  background: rgba(124, 86, 72, 0.42);
  color: #fff;
}

.chat-preset-btn:active {
  transform: scale(0.97);
}

.chat-preset-note {
  margin: 8px 2px 0;
  font-size: 10px;
  line-height: 1.45;
  color: rgba(235, 230, 236, 0.48);
}

.view[aria-pressed="true"] {
  border-color: rgba(238, 212, 202, 0.46);
  background: rgba(57, 42, 38, 0.5);
  color: rgba(255, 246, 240, 0.94);
}

.music {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.music::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e5c7ba;
  box-shadow: 0 0 10px rgba(230, 182, 160, 0.72);
  content: "";
}

.music[aria-pressed="false"]::before {
  background: rgba(235, 233, 239, 0.32);
  box-shadow: none;
}

.music:hover,
.view:hover,
.posture:hover,
.postcard:hover,
.music:focus-visible,
.view:focus-visible,
.posture:focus-visible,
.postcard:focus-visible {
  border-color: rgba(247, 232, 231, 0.48);
  background: rgba(31, 39, 52, 0.52);
  color: rgba(255, 252, 251, 0.94);
}

.footnote {
  position: absolute;
  right: clamp(20px, 3vw, 42px);
  bottom: 80px;
  margin: 0;
  color: rgba(237, 234, 240, 0.31);
  font-size: 9px;
  letter-spacing: 0.03em;
  transition: opacity 180ms ease;
}

body.music-open .footnote {
  opacity: 0;
  pointer-events: none;
}

body.capture .topbar,
body.capture .entry-screen,
body.capture .character-screen,
body.capture .look-hint,
body.capture .sit-prompt,
body.capture .audio-visualizer,
body.capture .people-panel,
body.capture .talk,
body.capture .music-panel,
body.capture .scene-actions,
body.capture .webview-banner,
body.capture .footnote {
  display: none;
}

@media (max-width: 720px) {
  .conditions {
    max-width: 46vw;
    text-align: right;
  }

  .sit-prompt {
    bottom: 108px;
    padding: 5px 12px 5px 9px;
    font-size: 11px;
  }

  .audio-visualizer {
    bottom: 66px;
    padding: 4px 10px;
  }

  #audioVisualizer {
    width: 156px;
    height: 22px;
  }

  .look-hint {
    display: none;
  }

  .footnote {
    display: none;
  }

  .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(560px, calc(100vw - 28px));
  }

  .character-main {
    width: min(560px, calc(100vw - 28px));
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .character-stage {
    width: min(280px, 76vw);
    height: 230px;
    min-height: 0;
    margin: 0 auto;
  }

  .character-card {
    grid-template-columns: 56px 1fr;
    padding: 8px;
  }

  .character-card img {
    width: 56px;
    height: 64px;
  }

  .people-panel {
    top: 82px;
    right: 12px;
    width: 154px;
    max-height: 38vh;
  }

  .person-card {
    gap: 7px;
  }

  .person-card img {
    width: 29px;
    height: 33px;
  }

  .talk {
    bottom: 82px;
  }

  .music-panel {
    right: 14px;
    bottom: 64px;
    width: min(320px, calc(100vw - 28px));
  }

  .scene-actions {
    right: 16px;
    bottom: 18px;
  }

  .music,
  .view,
  .posture,
  .postcard {
    padding: 8px 11px;
  }
}
