:root {
  --paper: #ffffff;
  --ink: #1f2738;
  --crayon-blue: #4a6fa5;
  --crayon-red: #c45c5c;
  --shadow-ink: rgba(42, 42, 42, 0.12);
  --profile-shell: rgba(255, 255, 255, 0.82);
  --profile-shell-2: rgba(248, 249, 247, 0.96);
  --profile-shell-border: rgba(31, 39, 56, 0.08);
  --profile-glow: rgba(150, 241, 246, 0.18);
  --profile-text: #111827;
  --profile-muted: #667085;
  --profile-card-surface: rgba(255, 255, 255, 0.78);
  --overlap: 2px;
  --video-side-cover-left: 30px;
  --video-side-cover-right: 60px;
  --video-nudge-y: 5px;
  --video-edge-feather: 88px;
  --dahaqian-v-cover-top: 20px;
  --dahaqian-v-cover-bottom: 30px;
  --dahaqian-nudge-y: 27px;
  --dahaqian-edge-feather: 64px;
  --dahaqian-delay-ms: 3000;
  --dahaqian-idle-ms: 4000;
  --avatar-zoom: 1;
  --avatar-ring-grow: 15px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: #ffffff;
  font-family: "Kalam", "Comic Sans MS", cursive;
  overflow-x: hidden;
}


a {
  color: inherit;
}

.page-center {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vh, 2.5rem);
  padding-bottom: clamp(10rem, 22vh, 13rem);
}

.profile-orbit {
  width: min(88vw, 1180px);
  height: min(78dvh, 52rem);
  min-height: 34rem;
  position: relative;
  z-index: 12;
  display: flex;
  flex-direction: column;
  transform-origin: center;
  border-radius: 36px;
  border: 1px solid var(--profile-shell-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 247, 244, 0.98));
  box-shadow:
    0 18px 40px rgba(31, 39, 56, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.profile-orbit::before {
  content: "";
  position: absolute;
  inset: 1.2rem;
  border-radius: 28px;
  border: 1px solid rgba(31, 39, 56, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.profile-orbit.is-hidden {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  user-select: none;
}

.profile-orbit.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 260ms ease, transform 260ms ease;
}

.profile-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 2.25rem 2.4rem;
  gap: 1.4rem;
}

.profile-panel__visual {
  flex: 0 0 43%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 0.5rem 1rem 0.5rem 0.25rem;
  background: transparent;
  border-right: none;
}

.profile-panel__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
  min-width: 0;
  min-height: 0;
  padding: 0.45rem 0 0.45rem 0.35rem;
}

.profile-panel__eyebrow {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(84, 98, 116, 0.7);
}

.profile-panel__title {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 3.55rem);
  line-height: 0.96;
  font-weight: 800;
  color: var(--profile-text);
  letter-spacing: -0.04em;
}

.profile-panel__lead {
  margin: 0 0 0.35rem;
  max-width: 32rem;
  color: rgba(86, 101, 118, 0.88);
  font-size: clamp(0.98rem, 1.8vw, 1.16rem);
  line-height: 1.55;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  min-height: 0;
  perspective: 1200px;
}

.profile-card {
  --card-rotate-x: 0deg;
  --card-rotate-y: 0deg;
  position: relative;
  background: var(--profile-card-surface);
  border: 1px solid rgba(31, 39, 56, 0.08);
  border-radius: 20px;
  padding: 1rem 1rem 0.92rem;
  box-shadow:
    0 10px 24px rgba(31, 39, 56, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  justify-content: flex-start;
  overflow: hidden;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transform-origin: center center;
  transform-style: preserve-3d;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 45%);
  pointer-events: none;
}

.profile-card:focus-visible {
  outline: 2px solid rgba(73, 111, 165, 0.72);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .profile-card:hover {
    transform: translateY(-4px) rotateX(var(--card-rotate-x)) rotateY(var(--card-rotate-y)) scale(1.01);
    border-color: rgba(31, 39, 56, 0.12);
    box-shadow:
      0 16px 30px rgba(31, 39, 56, 0.09),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }
}

.profile-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.25rem;
}

.profile-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(246, 248, 250, 0.9);
  border: 1px solid rgba(31, 39, 56, 0.08);
  color: #283244;
}

.profile-card__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: rgba(248, 249, 250, 0.82);
  border: 1px solid rgba(31, 39, 56, 0.08);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(111, 121, 136, 0.6);
}

.profile-card__title {
  margin: 0;
  font-size: clamp(0.98rem, 2vw, 1.08rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--profile-text);
  line-height: 1.2;
}

.profile-card__desc {
  margin: 0;
  font-size: clamp(0.84rem, 1.35vw, 0.92rem);
  line-height: 1.55;
  color: rgba(96, 108, 125, 0.82);
}

.profile-card__desc a {
  text-decoration: none;
  color: #111827;
  border-bottom: 1px dashed rgba(17, 24, 39, 0.34);
}

.profile-card__desc a:hover {
  border-bottom-style: solid;
}

.profile-card--mint .profile-card__icon {
  background: rgba(239, 248, 245, 0.95);
  border-color: rgba(31, 39, 56, 0.06);
}

.profile-card--lime .profile-card__icon {
  background: rgba(244, 249, 238, 0.95);
  border-color: rgba(31, 39, 56, 0.06);
}

.profile-card--cyan .profile-card__icon {
  background: rgba(239, 246, 250, 0.95);
  border-color: rgba(31, 39, 56, 0.06);
}

.profile-card--teal .profile-card__icon {
  background: rgba(238, 248, 245, 0.95);
  border-color: rgba(31, 39, 56, 0.06);
}

.profile-card--sky .profile-card__icon {
  background: rgba(240, 245, 250, 0.95);
  border-color: rgba(31, 39, 56, 0.06);
}

.profile-card--violet .profile-card__icon {
  background: rgba(245, 242, 250, 0.95);
  border-color: rgba(31, 39, 56, 0.06);
}

.profile-avatar {
  position: relative;
  z-index: 2;
  width: clamp(176px, 25vw, 248px);
  height: clamp(176px, 25vw, 248px);
  border-radius: 999px;
  overflow: visible;
  background: transparent;
}

.profile-avatar::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--avatar-ring-grow) - 8px);
  border-radius: 999px;
  border: 1px solid rgba(31, 39, 56, 0.08);
  background: transparent;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8),
    0 12px 24px rgba(31, 39, 56, 0.08);
}

.profile-avatar__clip {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 244, 246, 0.98));
  border: 1px solid rgba(31, 39, 56, 0.08);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  display: block;
  mix-blend-mode: normal;
  transform: scale(var(--avatar-zoom));
  transform-origin: center;
}

.profile-visual-stage {
  position: relative;
  width: min(100%, 29rem);
  min-height: 28rem;
  display: grid;
  place-items: center;
}

.profile-visual-ring,
.profile-visual-bubble,
.profile-visual-beam,
.profile-visual-base,
.profile-visual-tag {
  position: absolute;
}

.profile-visual-ring {
  width: clamp(18rem, 30vw, 25rem);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(220, 239, 243, 0.45),
    0 12px 30px rgba(177, 222, 227, 0.12);
}

.profile-visual-base {
  bottom: 2.1rem;
  width: 13rem;
  height: 2.4rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(167, 243, 248, 0.58), rgba(167, 243, 248, 0.2) 46%, transparent 76%);
  border: 1px solid rgba(220, 239, 243, 0.72);
  box-shadow: 0 0 42px rgba(166, 241, 246, 0.3);
}

.profile-visual-beam {
  bottom: 4rem;
  width: 8rem;
  height: 7rem;
  background: linear-gradient(180deg, rgba(183, 244, 247, 0.36), transparent 85%);
  clip-path: polygon(48% 0%, 52% 0%, 100% 100%, 0% 100%);
  filter: blur(0.5px);
}

.profile-visual-bubble {
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.98), rgba(177, 242, 246, 0.78) 60%, rgba(145, 214, 236, 0.74) 100%);
  box-shadow: 0 10px 24px rgba(166, 231, 235, 0.24);
}

.profile-visual-bubble--lg {
  top: 1.5rem;
  right: 2.8rem;
  width: 5.2rem;
  height: 5.2rem;
}

.profile-visual-bubble--md {
  left: 1.8rem;
  bottom: 4.6rem;
  width: 3.8rem;
  height: 3.8rem;
}

.profile-visual-bubble--sm {
  right: 3rem;
  bottom: 6.2rem;
  width: 1.2rem;
  height: 1.2rem;
}

.profile-visual-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.46);
  color: rgba(50, 61, 76, 0.9);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 18px rgba(171, 188, 197, 0.1);
  backdrop-filter: blur(12px);
}

.profile-visual-tag--left {
  left: 0.5rem;
  top: 6.25rem;
}

.profile-visual-tag--top {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
}

.profile-visual-tag--right {
  right: 0.4rem;
  top: 8.5rem;
}

.profile-center-note {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  padding: 0.72rem 1rem;
  max-width: 18rem;
  text-align: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(31, 39, 56, 0.08);
  box-shadow: 0 10px 20px rgba(31, 39, 56, 0.06);
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.profile-center-note strong {
  font-size: 0.96rem;
  color: var(--profile-text);
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.profile-center-note span {
  font-size: 0.78rem;
  color: rgba(96, 108, 125, 0.76);
  line-height: 1.4;
}

.muted {
  color: var(--profile-muted);
  font-size: inherit;
}

.profile-hint {
  position: absolute;
  top: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: rgba(73, 88, 105, 0.72);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(31, 39, 56, 0.08);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  pointer-events: none;
  user-select: none;
  backdrop-filter: blur(8px);
}

.dock {
  position: fixed;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  transform: translateX(-50%);
  width: min(92vw, 28rem);
  z-index: 10;
}

.barrage-layer {
  position: fixed;
  top: clamp(1rem, 4vh, 2.25rem);
  left: 5vw;
  right: 5vw;
  width: auto;
  height: min(80vh, 52rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
  z-index: 8;
}

.barrage-history-cluster {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.history-section,
.stream-section {
  pointer-events: none;
}

.history-slide-clip {
  overflow: hidden;
  height: var(--history-reveal, 0px);
  min-height: 0;
  max-width: 100%;
  pointer-events: none;
}

.history-slide-clip.is-history-interactive {
  pointer-events: auto;
}

.barrage-divider-host {
  position: relative;
  flex: 0 0 auto;
  padding-bottom: 4.75rem;
  pointer-events: none;
}

.barrage-divider-host .barrage-divider {
  margin-inline: 0.35rem;
}

.history-pull-station {
  position: absolute;
  right: clamp(0.65rem, 2.5vw, 1.25rem);
  top: 0;
  padding-top: 2px;
  pointer-events: auto;
  z-index: 3;
}

.history-pull-handle {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.55rem 0.65rem;
  background: transparent;
  cursor: grab;
  touch-action: none;
  line-height: 0;
  color: transparent;
}

.history-pull-handle:active {
  cursor: grabbing;
}

.history-pull-handle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--crayon-blue) 55%, white);
  outline-offset: 2px;
  border-radius: 10px;
}

.history-pull-svg {
  display: block;
  overflow: visible;
  width: 28px;
  height: 118px;
  transform-origin: 14px 4px;
  will-change: transform, filter;
}

.history-pull-svg.is-rope-fast {
  filter: drop-shadow(0 0.5px 0 rgba(255, 255, 255, 0.55)) blur(0.55px);
}

@media (prefers-reduced-motion: reduce) {
  .history-pull-svg {
    will-change: auto;
  }

  .history-pull-svg.is-rope-fast {
    filter: drop-shadow(0 0.5px 0 rgba(255, 255, 255, 0.65));
  }
}

.history-pull-mono {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.96;
  filter: drop-shadow(0 0.5px 0 rgba(255, 255, 255, 0.65));
}

.history-viewport,
.stream-viewport {
  pointer-events: auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.history-viewport::-webkit-scrollbar,
.stream-viewport::-webkit-scrollbar {
  width: 10px;
}

.history-viewport::-webkit-scrollbar-track,
.stream-viewport::-webkit-scrollbar-track {
  background: transparent;
}

.history-viewport::-webkit-scrollbar-thumb,
.stream-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 160ms ease;
}

.history-viewport.is-scrolling,
.stream-viewport.is-scrolling {
  scrollbar-color: color-mix(in srgb, var(--ink) 45%, transparent) transparent;
}

.history-viewport.is-scrolling::-webkit-scrollbar-thumb,
.stream-viewport.is-scrolling::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 22%, transparent);
}

.history-section {
  flex: 0 0 auto;
  min-width: 0;
}

.history-viewport {
  max-height: 4.6rem;
  padding-right: 0.45rem;
  will-change: transform;
  transform: translateY(calc(-1 * (var(--history-slot-h, 4.6rem) - var(--history-reveal, 0px))));
}

.history-board {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  padding: 0.05rem 0.1rem 0.25rem;
}

.history-card {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 30px;
  width: var(--history-card-width, 28rem);
  height: 2.55rem;
  padding: 0.32rem 0.75rem;
  border: 2px solid color-mix(in srgb, var(--ink) 78%, transparent);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 2px 3px 0 color-mix(in srgb, var(--crayon-blue) 78%, white),
    4px 6px 0 rgba(42, 42, 42, 0.08);
  cursor: pointer;
  overflow: hidden;
  transition: width 220ms ease, height 220ms ease, flex-basis 220ms ease,
    transform 180ms ease, box-shadow 180ms ease;
}

.history-card::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px dashed color-mix(in srgb, var(--crayon-red) 55%, transparent);
  opacity: 0.24;
  pointer-events: none;
}

.history-card:hover {
  transform: translateY(-1px);
}

.history-card__delete {
  position: absolute;
  top: 0.18rem;
  left: 0.22rem;
  z-index: 2;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0;
  transform: scale(0.88);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.history-card:hover .history-card__delete,
.history-card:focus-within .history-card__delete {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.history-card__delete:hover {
  background: rgba(255, 244, 244, 0.96);
}

.history-card.is-active {
  border-color: color-mix(in srgb, var(--crayon-blue) 62%, var(--ink));
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88),
    2px 3px 0 color-mix(in srgb, var(--crayon-blue) 76%, white),
    5px 7px 0 rgba(42, 42, 42, 0.1);
}

.history-card__preview,
.history-card__full {
  position: relative;
  z-index: 1;
  width: 100%;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.3;
}

.history-card__preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card__full {
  display: none;
  white-space: normal;
  word-break: break-word;
}

.history-card.is-mini {
  justify-content: center;
  padding: 0.35rem;
}

.history-card.is-mini .history-card__preview {
  text-align: center;
  font-size: 0.82rem;
}

.history-card.is-tiny {
  padding: 0.2rem;
  border-radius: 16px;
}

.history-card.is-tiny .history-card__preview {
  font-size: 0.74rem;
}

.barrage-divider {
  height: 0;
  border-top: 1px dashed color-mix(in srgb, var(--ink) 34%, transparent);
  opacity: 0.55;
  margin-inline: 0.35rem;
}

.barrage-board {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.95rem;
  width: min(60rem, calc(100vw - 5rem));
  max-width: 100%;
  margin-inline: auto;
  min-height: 100%;
  padding: 0.35rem 0.6rem 1.6rem;
  font-size: 1rem;
}

.stream-section {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.stream-viewport {
  height: 100%;
  padding-right: 0.45rem;
  position: relative;
}

.barrage-civility-hint {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 0.1rem 0 0.2rem;
  text-align: center;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--ink) 26%, transparent);
  pointer-events: none;
  user-select: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--paper, #fff) 88%, transparent) 0%,
    transparent 100%
  );
}

.barrage-item {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: color-mix(in srgb, var(--ink) 90%, transparent);
  font-size: clamp(0.96rem, 1.35vw, 1.02rem);
  line-height: 1.82;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  transform: translateY(0.6rem);
  opacity: 0;
  animation: barrage-settle var(--barrage-duration, 1200ms)
    cubic-bezier(0.2, 0.8, 0.2, 1)
    forwards;
  text-align: left;
  will-change: opacity, transform;
}

.barrage-item::before {
  display: none;
}

.barrage-item.is-settled {
  transform: translateY(0);
  transition: opacity 180ms ease;
}

.barrage-item--user {
  margin-bottom: -0.15rem;
}

.barrage-item--user .barrage-label {
  text-align: left;
  justify-content: flex-start;
  display: inline-flex;
  width: auto;
  max-width: min(34rem, calc(100vw - 7rem));
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--crayon-blue) 42%, transparent);
  background: color-mix(in srgb, #edf5ff 56%, var(--paper) 44%);
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--crayon-blue) 44%, white),
    4px 5px 0 rgba(42, 42, 42, 0.06);
  color: color-mix(in srgb, var(--ink) 76%, transparent);
  font-size: 0.92rem;
  line-height: 1.55;
}

.barrage-item--civility-rage .barrage-label {
  font-weight: 900;
  font-size: clamp(1.05rem, 2.4vw, 1.22rem);
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: #e84393;
  text-shadow:
    0 0 10px color-mix(in srgb, #ffb3d9 70%, transparent),
    0 0 1px color-mix(in srgb, #ff69b4 55%, transparent),
    0 1px 0 rgba(0, 0, 0, 0.1);
  animation: civility-rage-shake 0.14s ease-in-out infinite alternate;
}

.barrage-item--civility-countdown .barrage-label {
  font-weight: 900;
  font-size: var(--civ-count-px, 2rem);
  line-height: 1.15;
  color: #d63384;
  text-shadow:
    2px 2px 0 color-mix(in srgb, #ff9ecf 50%, transparent),
    0 0 16px color-mix(in srgb, #ff69b4 42%, transparent);
}

.barrage-item--civility-quote .barrage-label {
  font-weight: 700;
  font-size: clamp(1.02rem, 2.5vw, 1.26rem);
  line-height: 1.65;
  letter-spacing: 0.06em;
  color: #5c1010;
  padding: 0.35rem 0 0.35rem 0.85rem;
  margin-block: 0.12rem;
  border-left: 4px solid #8b0000;
}

@keyframes civility-rage-shake {
  from {
    transform: translateX(-1.5px);
  }
  to {
    transform: translateX(1.5px);
  }
}

.barrage-item.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: auto;
  padding: 0.28rem 0;
  color: color-mix(in srgb, var(--ink) 68%, transparent);
}

.barrage-label {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  text-align: left;
}

.wave-char {
  display: inline-block;
  transform: translate3d(var(--wave-x, 0px), var(--wave-y, 0px), 0);
  transition: transform 120ms linear;
  will-change: transform;
}

.wave-char--space {
  width: 0.34em;
}

.barrage-token {
  display: inline-block;
  padding: 0.02rem 0.32rem 0.05rem;
  margin: 0 0.02rem;
  border-radius: 0.5rem;
  border-bottom: 1px dashed currentColor;
  font-weight: 700;
  vertical-align: baseline;
}

.md-inline--strong {
  font-weight: 800;
}

.md-inline--code {
  display: inline-block;
  padding: 0.04rem 0.38rem;
  border-radius: 0.45rem;
  font-family: "Fira Code", "SFMono-Regular", monospace;
  font-size: 0.92em;
  color: #4f4b79;
  background: rgba(214, 208, 236, 0.62);
  border: 1px dashed rgba(79, 75, 121, 0.26);
}

.barrage-item--heading {
  margin-top: 0.2rem;
}

.barrage-item--heading .barrage-label {
  font-weight: 800;
  display: inline-block;
  width: auto;
  padding: 0.22rem 0.85rem 0.28rem;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 74%, transparent);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--paper) 78%, #f6e4a8 22%) 0%,
    color-mix(in srgb, var(--paper) 84%, #f1d79a 16%) 52%,
    color-mix(in srgb, var(--paper) 88%, #edd3b1 12%) 100%
  );
  box-shadow: 2px 2px 0 color-mix(in srgb, #d7b35a 58%, white),
    4px 5px 0 rgba(42, 42, 42, 0.08);
  font-size: 1.03em;
  line-height: 1.45;
}

.barrage-item--heading-level-1 {
  margin-left: 0;
}

.barrage-item--heading-level-1 .barrage-label {
  font-size: 1.12em;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--paper) 74%, #f3d37a 26%) 0%,
    color-mix(in srgb, var(--paper) 82%, #efcf93 18%) 52%,
    color-mix(in srgb, var(--paper) 86%, #e6c59d 14%) 100%
  );
}

.barrage-item--heading-level-2 {
  margin-left: 0.85rem;
}

.barrage-item--heading-level-2 .barrage-label {
  font-size: 1.04em;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--paper) 80%, #f6e4a8 20%) 0%,
    color-mix(in srgb, var(--paper) 86%, #ead7a7 14%) 52%,
    color-mix(in srgb, var(--paper) 90%, #e7d8bd 10%) 100%
  );
}

.barrage-item--heading-level-3 {
  margin-left: 1.45rem;
}

.barrage-item--heading-level-3 .barrage-label {
  font-size: 1em;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--paper) 84%, #dfeaf5 16%) 0%,
    color-mix(in srgb, var(--paper) 90%, #e8edf4 10%) 56%,
    color-mix(in srgb, var(--paper) 93%, #ece6de 7%) 100%
  );
}

.barrage-item--indent-0 {
  margin-left: 0;
}

.barrage-item--indent-1:not(.barrage-item--heading) {
  margin-left: 0.85rem;
}

.barrage-item--indent-2:not(.barrage-item--heading) {
  margin-left: 1.45rem;
}

.barrage-item--quote {
  border-left-width: 4px;
  border-left-style: solid;
  border-left-color: color-mix(in srgb, var(--crayon-blue) 46%, transparent);
  padding-left: 0.9rem;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}

.barrage-item--list,
.barrage-item--ordered {
  padding-left: 0.4rem;
}

.barrage-item--code {
  width: 100%;
  max-width: min(46rem, calc(100vw - 6rem));
  padding: 0.85rem 1rem;
  border-radius: 1rem 1rem 1.2rem 1rem;
  border: 1px dashed rgba(79, 75, 121, 0.24);
  background: color-mix(in srgb, var(--paper) 92%, #ede9f7 8%);
  box-shadow: 0 10px 22px rgba(42, 42, 42, 0.05);
}

.barrage-item--code .barrage-label {
  display: block;
  width: 100%;
  font-family: "Fira Code", "SFMono-Regular", monospace;
  white-space: pre-wrap;
  line-height: 1.55;
}

.barrage-item--divider {
  width: 100%;
  min-height: 0;
  padding: 0.15rem 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.barrage-item--divider::before {
  display: none;
}

.barrage-item--divider .barrage-label {
  width: 100%;
  min-height: 0;
  border-top: 1px dashed color-mix(in srgb, var(--ink) 34%, transparent);
}

.barrage-token--ok {
  color: #325e2c;
  background: rgba(181, 217, 163, 0.55);
}

.barrage-token--err {
  color: #8d2f2f;
  background: rgba(232, 184, 177, 0.58);
}

.barrage-token--warn {
  color: #8a5a13;
  background: rgba(244, 214, 145, 0.62);
}

.barrage-token--info {
  color: #2d597c;
  background: rgba(178, 210, 234, 0.58);
}

.barrage-token--flow {
  color: #2e665c;
  background: rgba(176, 221, 209, 0.58);
}

.barrage-token--action {
  color: #7b4d13;
  background: rgba(239, 205, 156, 0.68);
}

.barrage-token--decision {
  color: #6b4025;
  background: rgba(230, 193, 168, 0.68);
}

.barrage-token--label {
  color: #74461d;
  background: rgba(239, 210, 170, 0.76);
}

.barrage-token--quote {
  color: #6a4a7f;
  background: rgba(225, 208, 238, 0.76);
}

.barrage-token--step {
  color: #2f5f4f;
  background: rgba(188, 223, 207, 0.76);
}

.barrage-token--structure {
  color: #315f78;
  background: rgba(190, 220, 234, 0.64);
}

.barrage-token--time {
  color: #2f5d74;
  background: rgba(182, 214, 229, 0.66);
}

.barrage-token--metric {
  color: #4d4b8c;
  background: rgba(205, 201, 235, 0.68);
}

.barrage-token--code {
  color: #53425d;
  background: rgba(214, 199, 219, 0.68);
}

.barrage-token--term {
  color: #4f4b79;
  background: rgba(214, 208, 236, 0.72);
}

.barrage-token--joy {
  color: #8d5b12;
  background: rgba(255, 224, 145, 0.7);
}

.barrage-token--warm {
  color: #8b5a4a;
  background: rgba(244, 209, 186, 0.7);
}

.barrage-token--hope {
  color: #2b6080;
  background: rgba(182, 225, 230, 0.65);
}

.barrage-token--power {
  color: #5b3d12;
  background: rgba(229, 193, 138, 0.68);
}

.barrage-token--romantic {
  color: #8b4768;
  background: rgba(235, 196, 213, 0.68);
}

.barrage-token--calm {
  color: #34625d;
  background: rgba(192, 226, 216, 0.62);
}

.barrage-token--neg {
  color: #6d445d;
  background: rgba(213, 191, 206, 0.66);
}

.barrage-spinner {
  position: relative;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 2px dashed color-mix(in srgb, var(--crayon-red) 72%, transparent);
  border-top-color: var(--ink);
  animation: barrage-spin 900ms linear infinite;
}

@keyframes barrage-settle {
  0% {
    transform: translateY(0.7rem);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes barrage-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

body.is-profile-orbit-visible .stream-viewport {
  overflow-y: auto;
}

body.is-profile-orbit-visible .barrage-history-cluster {
  display: none;
}

body.is-profile-orbit-visible .stream-section {
  display: none;
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.video-wrap {
  position: absolute;
  bottom: calc(100% - 25px);
  left: 50%;
  transform: translate(-50%, calc(-1 * var(--video-nudge-y)));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.video-wrap.is-visible {
  opacity: 1;
  visibility: visible;
}

.video-wrap video {
  display: block;
  max-height: min(38vh, 220px);
  width: auto;
  max-width: min(90vw, 320px);
  border-radius: 4px;
  clip-path: inset(60px 60px 0 60px);
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(
      ellipse 50% 70% at 50% 70%,
      #000 38%,
      rgba(0, 0, 0, 0.5) 61%,
      rgba(0, 0, 0, 0.16) 82%,
      transparent 100%
    ),
    linear-gradient(
      to left,
      hsl(0 0% 0% / 0) 0%,
      hsl(0 0% 0% / 0.18) calc(var(--video-edge-feather) * 0.28),
      hsl(0 0% 0% / 0.72) calc(var(--video-edge-feather) * 0.62),
      hsl(0 0% 0% / 1) 100%
    );
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(
       ellipse 50% 70% at 50% 70%,
      #000 38%,
      rgba(0, 0, 0, 0.5) 61%,
      rgba(0, 0, 0, 0.16) 82%,
      transparent 100%
    ),
    linear-gradient(
      to left,
      hsl(0 0% 0% / 0) 0%,
      hsl(0 0% 0% / 0.18) calc(var(--video-edge-feather) * 0.28),
      hsl(0 0% 0% / 0.72) calc(var(--video-edge-feather) * 0.62),
      hsl(0 0% 0% / 1) 100%
    );
  mask-composite: intersect;
  -webkit-mask-size: 100% 100%, 100% 100%;
  mask-size: 100% 100%, 100% 100%;
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: center, center;
  mask-position: center, center;
  mask-mode: alpha;
}

.video-wrap video,
.character,
.character-followup {
  pointer-events: auto;
  cursor: pointer;
}

.crayon-field {
  position: relative;
  flex: 1 1 auto;
  z-index: 1;
  width: auto;
  padding: 0.4rem 0.75rem 0.5rem;
  min-height: 1.6rem;
  background: #ffffff;
  border-radius: 255px 25px 225px 25px / 25px 225px 25px 255px;
  border: 3px solid var(--ink);
  box-shadow: 3px 4px 0 var(--crayon-blue), 6px 8px 0 var(--shadow-ink);
  transform: rotate(-0.4deg);
  cursor: text;
}

.crayon-field__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.crayon-field__row input {
  flex: 1 1 auto;
  min-width: 0;
}

.voice-dock-trigger {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  padding: 0;
  border-radius: 255px 20px 240px 20px / 20px 235px 20px 240px;
  border: 2px solid color-mix(in srgb, var(--ink) 35%, transparent);
  background: color-mix(in srgb, var(--paper) 92%, #e8efe7 8%);
  color: color-mix(in srgb, var(--ink) 78%, transparent);
  cursor: pointer;
  transform: rotate(1.8deg);
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--crayon-blue) 45%, transparent);
}

.voice-dock-trigger:hover {
  background: color-mix(in srgb, var(--paper) 88%, #dfeadc 12%);
  color: var(--ink);
}

.voice-dock-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--crayon-blue) 55%, transparent);
  outline-offset: 2px;
}

.voice-dock-trigger__svg {
  width: 1.05rem;
  height: 1.05rem;
  pointer-events: none;
}

.crayon-field::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px dashed color-mix(in srgb, var(--crayon-red) 55%, transparent);
  opacity: 0.45;
  pointer-events: none;
}

.chat-controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  padding-top: 1.3rem;
}

.chat-status-badges {
  position: absolute;
  top: 0;
  right: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-mode-badge {
  position: static;
  margin: 0;
  padding: 0.22rem 0.62rem;
  border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 90%, #e8efe7 10%);
  color: color-mix(in srgb, var(--ink) 68%, transparent);
  font: inherit;
  font-size: 0.74rem;
  line-height: 1.1;
  cursor: pointer;
}

.chat-mode-badge:hover {
  background: color-mix(in srgb, var(--paper) 86%, #dfeadc 14%);
}

.chat-usage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.7rem;
  padding: 0.22rem 0.62rem;
  border: 1.5px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 92%, #e7edf4 8%);
  color: color-mix(in srgb, var(--ink) 62%, transparent);
  font-size: 0.74rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}

.chat-usage-badge.is-blocked {
  color: #7d3329;
  background: color-mix(in srgb, var(--paper) 88%, #f4d9d2 12%);
  border-color: color-mix(in srgb, var(--crayon-red) 30%, transparent);
}

.chat-dialog {
  position: fixed;
  top:50%;
  left:50%;
  transform: translate(-50%, -50%);
  /* 高于语音全屏（.voice-control-portal），否则看不见「选择对话方式」等弹窗 */
  z-index: 62;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.32);
}

.chat-dialog[hidden] {
  display: none;
}

.chat-dialog__card {
  content: "";
  position: relative;
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.9rem 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.98);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 3px 4px 0 var(--crayon-blue), 6px 8px 0 rgba(42, 42, 42, 0.1);
}

.chat-dialog__card::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1px dashed color-mix(in srgb, var(--crayon-red) 55%, transparent);
  opacity: 0.32;
  pointer-events: none;
}

.chat-dialog__title {
  position: relative;
  z-index: 1;
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  line-height: 1.2;
  color: var(--ink);
}

.chat-dialog__tip {
  position: relative;
  z-index: 1;
  margin: 0 0 0.7rem;
  font-size: 0.74rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 76%, transparent);
}

.chat-dialog__option,
.chat-dialog__field {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.45rem;
  font-size: 0.84rem;
  color: var(--ink);
}

.chat-dialog__field {
  flex-direction: column;
  align-items: stretch;
  gap: 0.28rem;
}

.chat-dialog__field span {
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--ink) 68%, transparent);
}

.chat-dialog__field input {
  width: 100%;
  border: 1.5px solid color-mix(in srgb, var(--ink) 34%, transparent);
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--paper) 94%, #f2ead7 6%);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  padding: 0.45rem 0.55rem;
  outline: none;
}

.chat-dialog__actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.chat-dialog__button {
  padding: 0.38rem 0.8rem;
  border: 1.5px solid color-mix(in srgb, var(--ink) 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 90%, #e8efe7 10%);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.chat-dialog__button.is-ghost {
  background: color-mix(in srgb, var(--paper) 96%, transparent);
}

.profile-popup-dialog {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.25rem;
  background: rgba(239, 238, 236, 0.2);
  backdrop-filter: blur(4px);
}

.profile-popup-dialog[hidden] {
  display: none;
}

.profile-popup {
  position: relative;
  width: min(22.2rem, calc(100vw - 2rem));
  padding: 1.05rem 1.05rem 1rem;
  border-radius: 1.3rem;
  border: 1px solid rgba(31, 39, 56, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 247, 244, 0.98));
  box-shadow:
    0 16px 30px rgba(31, 39, 56, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.profile-popup::before {
  content: "";
  position: absolute;
  inset: 0.7rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(31, 39, 56, 0.05);
  pointer-events: none;
}

.profile-popup__header,
.profile-popup__body {
  position: relative;
  z-index: 1;
}

.profile-popup__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.profile-popup__avatar {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, #eef2f5, #f8fafb);
  box-shadow: 0 6px 14px rgba(31, 39, 56, 0.07);
}

.profile-popup__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-popup__icon-button {
  border: 1px solid rgba(31, 39, 56, 0.08);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.profile-popup__icon-button {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}

.profile-popup__title {
  margin: 0;
  font-size: clamp(1.52rem, 4vw, 1.8rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #1d2432;
}

.profile-popup__subtitle {
  margin: 0.24rem 0 0;
  font-size: 0.93rem;
  line-height: 1.5;
  color: rgba(72, 86, 104, 0.72);
}

.profile-popup__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.82rem;
}

.profile-popup__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: rgba(249, 249, 247, 0.9);
  color: #344054;
  font-size: 0.76rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 39, 56, 0.06);
}

.profile-popup__content {
  margin-top: 0.9rem;
  padding: 0.82rem 0.9rem;
  border-radius: 0.9rem;
  background: rgba(250, 250, 248, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(31, 39, 56, 0.05);
}

.profile-popup__content-list {
  margin: 0.55rem 0 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.42rem;
  color: #243041;
  font-size: 0.9rem;
  line-height: 1.52;
}

.profile-popup__content-item::marker {
  color: rgba(73, 111, 165, 0.78);
}

.profile-popup__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 0.2rem 0;
}

.profile-popup__enter-button {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(20rem, calc(100vw - 3.6rem));
  margin: 0;
  min-height: 3rem;
  padding: 0.7rem 1.05rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 39, 56, 0.08);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(247, 248, 246, 0.92) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 18px rgba(31, 39, 56, 0.06),
    0 2px 6px rgba(42, 42, 42, 0.03);
  color: #1d2432;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease,
    border-color 180ms ease;
  backdrop-filter: blur(6px);
}

.profile-popup__enter-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.03) 58%,
    rgba(145, 192, 222, 0.03)
  );
  pointer-events: none;
}

.profile-popup__enter-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(250, 250, 248, 0.96) 100%
  );
  border-color: rgba(31, 39, 56, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 12px 24px rgba(31, 39, 56, 0.08),
    0 4px 10px rgba(42, 42, 42, 0.04);
}

.profile-popup__enter-button:focus-visible {
  outline: 2px solid rgba(73, 111, 165, 0.72);
  outline-offset: 3px;
}

.profile-popup__enter-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.profile-popup__stat {
  position: relative;
  display: grid;
  gap: 0.12rem;
  text-align: center;
}

.profile-popup__stat + .profile-popup__stat::before {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: -0.38rem;
  width: 1px;
  background: rgba(31, 39, 56, 0.08);
}

.profile-popup__stat-value {
  font-size: 1.08rem;
  line-height: 1.1;
  font-weight: 800;
  color: #1d2432;
}

.profile-popup__stat-label {
  font-size: 0.76rem;
  line-height: 1.25;
  color: rgba(92, 104, 120, 0.74);
}

.profile-popup__icon-button:focus-visible,
.profile-popup__icon-button:focus-visible {
  outline: 2px solid rgba(73, 111, 165, 0.72);
  outline-offset: 2px;
}

.crayon-field input {
  position: relative;
  z-index: 1;
  width: auto;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.25;
  color: var(--ink);
  caret-color: var(--ink);
  outline: none;
  padding: 0.12rem 0.1rem;
  text-align: center;
  transform: rotate(0.4deg);
}

.crayon-field input::placeholder {
  color: color-mix(in srgb, var(--ink) 42%, transparent);
}

.crayon-field input::selection {
  background: color-mix(in srgb, var(--crayon-blue) 18%, white);
  color: var(--ink);
}

.crayon-field.has-character input {
  padding-top: 0.6rem;
}

.character-slot {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 0.35rem);
  transform: translateX(-50%);
  height: clamp(100px, 28vw, 150px);
  width: 85%;
  max-width: 100%;
  pointer-events: none;
  z-index: 2;
  isolation: isolate;
}

.character-slot::before,
.character-slot::after {
  display: none;
}

.character {
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, transform 0.45s ease;
  z-index: 2;
  mix-blend-mode: normal;
  filter: none;
  clip-path: inset(0 0 0.45rem 0);
  -webkit-mask-image:
    radial-gradient(ellipse 78% 88% at 50% 62%, #000 40%, rgba(0, 0, 0, 0.7) 62%, rgba(0, 0, 0, 0.18) 82%, transparent 100%),
    linear-gradient(to top, #000 0%, #000 54%, rgba(0, 0, 0, 0.72) 76%, rgba(0, 0, 0, 0.16) 90%, transparent 100%);
  mask-image:
    radial-gradient(ellipse 78% 88% at 50% 62%, #000 40%, rgba(0, 0, 0, 0.7) 62%, rgba(0, 0, 0, 0.18) 82%, transparent 100%),
    linear-gradient(to top, #000 0%, #000 54%, rgba(0, 0, 0, 0.72) 76%, rgba(0, 0, 0, 0.16) 90%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  -webkit-mask-size: 100% 100%, 100% 100%;
  mask-size: 100% 100%, 100% 100%;
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: center, center;
  mask-position: center, center;
  mask-mode: alpha;
}

.character.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

.character-followup {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translate(-50%, var(--dahaqian-nudge-y));
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
  opacity: 0;
  visibility: hidden;
  z-index: 3;
  mix-blend-mode: normal;
  clip-path: inset(var(--dahaqian-v-cover-top) 0 var(--dahaqian-v-cover-bottom) 0);
  -webkit-mask-image: radial-gradient(
      ellipse 94% 90% at 50% 58%,
      #000 36%,
      rgba(0, 0, 0, 0.5) 60%,
      rgba(0, 0, 0, 0.14) 83%,
      transparent 100%
    ),
    linear-gradient(
      to bottom,
      hsl(0 0% 0% / 0) 0%,
      hsl(0 0% 0% / 0.2) calc(var(--dahaqian-edge-feather) * 0.3),
      hsl(0 0% 0% / 1) calc(var(--dahaqian-edge-feather) * 0.75),
      hsl(0 0% 0% / 1) calc(100% - var(--dahaqian-edge-feather) * 0.75),
      hsl(0 0% 0% / 0.2) calc(100% - var(--dahaqian-edge-feather) * 0.3),
      hsl(0 0% 0% / 0) 100%
    );
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(
      ellipse 94% 90% at 50% 58%,
      #000 36%,
      rgba(0, 0, 0, 0.5) 60%,
      rgba(0, 0, 0, 0.14) 83%,
      transparent 100%
    ),
    linear-gradient(
      to bottom,
      hsl(0 0% 0% / 0) 0%,
      hsl(0 0% 0% / 0.2) calc(var(--dahaqian-edge-feather) * 0.3),
      hsl(0 0% 0% / 1) calc(var(--dahaqian-edge-feather) * 0.75),
      hsl(0 0% 0% / 1) calc(100% - var(--dahaqian-edge-feather) * 0.75),
      hsl(0 0% 0% / 0.2) calc(100% - var(--dahaqian-edge-feather) * 0.3),
      hsl(0 0% 0% / 0) 100%
    );
  mask-composite: intersect;
  -webkit-mask-size: 100% 100%, 100% 100%;
  mask-size: 100% 100%, 100% 100%;
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: center, center;
  mask-position: center, center;
  mask-mode: alpha;
}

.character-followup.is-playing {
  opacity: 1;
  visibility: visible;
}

.character-slot.is-playing-dahaqian .character {
  opacity: 0;
  visibility: hidden;
}

.noscript-tip {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 30rem);
  background: #fff6e0;
  border: 1px solid #c8a748;
  color: #6c5520;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.ico {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
}

.profile-card .ico {
  width: 14px;
  height: 14px;
}

@media (max-width: 720px) {
  .profile-orbit {
    width: 92%;
    height: auto;
    min-height: min(85dvh, 40rem);
    max-height: none;
  }

  .profile-panel {
    flex-direction: column;
  }

  .profile-panel__visual {
    flex: none;
    width: 100%;
    border-right: none;
    border-bottom: 1px dashed #cfcfcf;
    padding: 1.1rem 1rem 1.25rem;
  }

  .profile-panel__main {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    grid-template-rows: none;
    grid-template-columns: none;
  }

  .profile-panel__heading {
    grid-column: unset;
    grid-row: unset;
    align-self: flex-start;
  }

  .profile-grid {
    grid-column: unset;
    grid-row: unset;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    overflow: visible;
    min-height: auto;
  }

  .profile-card__desc {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
  }

  .barrage-item {
    max-width: min(78vw, 20rem);
  }

  .barrage-layer {
    left: 1rem;
    right: 1rem;
    width: auto;
    height: min(80vh, 40rem);
  }

  .history-viewport {
    max-height: 4rem;
  }

  .profile-popup {
    width: min(22rem, calc(100vw - 1.5rem));
    padding: 1rem;
    border-radius: 1.6rem;
  }

  .profile-popup::before {
    inset: 0.72rem;
    border-radius: 1.2rem;
  }

  .profile-popup__stats {
    gap: 0.55rem;
  }

}

/* ---- Voice chat (Fish TTS proxy + SpeechRecognition) ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.voice-control-portal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.75rem 1rem 2.5rem;
  pointer-events: none;
}

.voice-control-portal[hidden] {
  display: none;
}

.voice-control-portal__frost {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
  cursor: default;
}

.voice-control-portal__close-fab {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  pointer-events: auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #1f2738 14%, transparent);
  background: rgba(255, 255, 255, 0.92);
  color: color-mix(in srgb, #1f2738 88%, transparent);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(31, 39, 56, 0.08);
}

.voice-control-portal__close-fab:hover {
  background: #fff;
}

.voice-control-portal__close-fab:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.45);
  outline-offset: 2px;
}

.voice-control-card {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1.15rem 1.2rem 1.05rem;
  border-radius: 20px;
  border: 1px solid rgba(31, 39, 56, 0.12);
  background: #fff;
  box-shadow: 0 18px 48px rgba(31, 39, 56, 0.12), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.voice-control-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.voice-control-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #161c24;
}

.voice-control-card__net {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: #059669;
  white-space: nowrap;
}

.voice-control-card__net.is-muted {
  color: #6b7280;
}

.voice-control-card__net.is-warn {
  color: #b45309;
}

.voice-control-card__net-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.voice-control-card__net.is-muted .voice-control-card__net-dot {
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.2);
}

.voice-control-card__net.is-warn .voice-control-card__net-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.voice-control-card__rule {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0.85rem 0;
}

.voice-control-card__mic-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.voice-mic-ring {
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 999px;
  padding: 0;
  border: 2px solid #10b981;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.15);
}

.voice-mic-ring__inner {
  width: 3.45rem;
  height: 3.45rem;
  border-radius: 999px;
  background: #fff;
  display: grid;
  place-items: center;
  color: #10b981;
}

.voice-mic-ring__ico {
  width: 1.55rem;
  height: 1.55rem;
}

.voice-mic-ring[aria-pressed="true"] {
  border-color: #059669;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12);
}

.voice-mic-ring:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.5);
  outline-offset: 3px;
}

.voice-control-card__mic-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
}

.voice-control-card__pickers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.voice-picker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 12px;
  background: #f3f4f6;
}

.voice-picker__lead {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.voice-picker__badge {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.voice-picker__label {
  font-size: 0.72rem;
  color: #6b7280;
  width: 4.2rem;
}

.voice-picker__select {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  outline: none;
}

.voice-control-card__listen {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.voice-control-card__pulse {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  margin-top: 0.32rem;
  background: #10b981;
  flex-shrink: 0;
}

.voice-control-card__pulse.is-on {
  animation: voice-pulse 1.1s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.86);
  }
}

.voice-control-card__listen-line {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #059669;
}

.voice-control-card__listen-sub {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.72rem;
  color: #9ca3af;
  font-weight: 400;
}

.voice-rec-snippet {
  border-radius: 12px;
  background: #f3f4f6;
  padding: 0.55rem 0.6rem 0.6rem;
}

.voice-rec-snippet__label {
  font-size: 0.68rem;
  color: #6b7280;
  margin-bottom: 0.45rem;
}

.voice-rec-snippet--assist {
  margin-top: 0.48rem;
}

.voice-rec-snippet__hint {
  margin: -0.06rem 0 0.42rem;
  font-size: 0.67rem;
  line-height: 1.4;
  color: #6b7280;
}

.voice-rec-snippet--assist .voice-rec-snippet__time {
  min-width: 5.4rem;
}

.voice-rec-snippet__row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.voice-rec-snippet__play {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #10b981;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.voice-rec-snippet__play:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-rec-snippet__wave {
  flex: 1 1 auto;
  height: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(16, 185, 129, 0.15) 0%,
    rgba(16, 185, 129, 0.35) 35%,
    rgba(16, 185, 129, 0.12) 70%,
    rgba(16, 185, 129, 0.22) 100%
  );
  opacity: 0.55;
}

.voice-rec-snippet__time {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: #9ca3af;
  min-width: 2.2rem;
  text-align: right;
}

.voice-rec-snippet__speed {
  flex: 0 0 auto;
  min-width: 2rem;
  padding: 0.22rem 0.45rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font: inherit;
  font-size: 0.68rem;
  color: #4b5563;
  cursor: pointer;
}

.voice-rec-snippet__text {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #4b5563;
  word-break: break-word;
}

.voice-rec-snippet__text.muted {
  color: #9ca3af;
}

.voice-control-card__error {
  margin: 0.55rem 0 0;
  font-size: 0.74rem;
  color: #b91c1c;
}
