/* ============================================================
   EchoChat · Motion & Ambience
   背景粒子层 / 过场动画 / 主题设置面板 / 创建向导 / 微交互
   ============================================================ */

/* ---- 背景氛围层（固定在 #app 之下，不随 render 重建）---- */
.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-layer canvas {
  position: absolute;
  inset: 0;
  display: block;
}
.ambient-caustic {
  mix-blend-mode: screen;
  opacity: 0.92;
}
#app {
  position: relative;
  z-index: 1;
}

/* ---- V1.1 motion primitives (ripple, ease-out, opacity/transform) ---- */
.motion-enter {
  animation: motion-enter var(--dur-normal) var(--ease-out) both;
}
@keyframes motion-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.motion-sheet {
  animation: motion-sheet var(--dur-normal) var(--ease-drawer, var(--ease-out)) both;
}
@keyframes motion-sheet {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
.motion-press:active:not(:disabled) {
  transform: scale(0.97);
}
.motion-msg,
.msg-appear .msg-bubble {
  animation: msg-rise var(--dur-slow) var(--ease-out) both;
}

/* ---- Landing：让氛围层透出来 ---- */
.landing {
  position: relative;
  background: transparent;
}
.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, color-mix(in oklab, var(--color-mint), transparent 84%), transparent 55%),
    radial-gradient(ellipse 90% 60% at 50% 0%, color-mix(in oklab, var(--color-primary), transparent 90%), transparent 50%);
}
.welcome-screen {
  position: relative;
  z-index: 1;
}
/* 文字区托一层柔光，粒子再密也不抢读 */
.welcome-screen::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(140%, 620px);
  height: min(90%, 520px);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, color-mix(in oklab, var(--color-bg), transparent 8%) 0%, transparent 70%);
  filter: blur(18px);
  pointer-events: none;
  z-index: -1;
}
.welcome-mark {
  position: relative;
}
.welcome-mark svg {
  box-shadow: 0 10px 40px color-mix(in oklab, var(--color-primary), transparent 60%);
}
.welcome-mark::before,
.welcome-mark::after {
  content: "";
  position: absolute;
  border: 2px solid color-mix(in oklab, var(--color-primary), transparent 45%);
  border-radius: 50%;
  animation: ripple-breathe 4s var(--ease-out) infinite;
  pointer-events: none;
}
.welcome-mark::before {
  inset: -10px;
}
.welcome-mark::after {
  inset: -22px;
  opacity: 0.45;
  animation-delay: 1.2s;
}
@keyframes ripple-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.35;
  }
}

/* slogan 逐字浮现 */
.welcome-lead {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  letter-spacing: 0.14em;
}
.welcome-lead .lead-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur-normal) var(--ease-out), transform var(--dur-normal) var(--ease-out);
}
.welcome-lead .lead-char.on {
  opacity: 1;
  transform: translateY(0);
}
.welcome-screen h1,
.welcome-actions {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.welcome-screen h1.on,
.welcome-actions.on {
  opacity: 1;
  transform: translateY(0);
}

/* 桌面端落地页放大一档，不然 1440 屏上显得很局促 */
@media (min-width: 1024px) {
  .welcome-screen {
    max-width: 520px;
  }
  .welcome-screen h1 {
    font-size: 40px;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
  }
  .welcome-lead {
    font-size: 18px;
    letter-spacing: 0.16em;
    margin-bottom: 40px;
  }
  .welcome-mark,
  .welcome-mark svg {
    width: 84px;
    height: 84px;
  }
  .welcome-mark {
    margin-bottom: 30px;
  }
  .welcome-mark svg {
    border-radius: 21px;
  }
}

/* ---- 视图过场 ---- */
.landing.landing-exit {
  animation: landing-out var(--dur-slow) var(--ease-out) both;
  pointer-events: none;
}
@keyframes landing-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.03);
  }
}
.app-shell.app-enter {
  animation: app-in var(--dur-slow) var(--ease-out) both;
}
@keyframes app-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.tab-enter .list-pane,
.tab-enter .moments-pane,
.tab-enter .me-pane {
  animation: tab-crossfade var(--dur-normal) var(--ease-out) both;
}
@keyframes tab-crossfade {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.994);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.tab-enter .moment-entry {
  animation: moment-in var(--dur-normal) var(--ease-out) both;
}
.tab-enter .moment-day:nth-child(2) .moment-entry {
  animation-delay: 0.04s;
}
.tab-enter .moment-day:nth-child(3) .moment-entry {
  animation-delay: 0.08s;
}
.tab-enter .moment-day:nth-child(4) .moment-entry {
  animation-delay: 0.12s;
}
.tab-enter .moment-day-rail .moment-entry:nth-child(2) {
  animation-delay: 0.04s;
}
.tab-enter .moment-day-rail .moment-entry:nth-child(3) {
  animation-delay: 0.08s;
}
@keyframes moment-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- 消息浮现 / 发送脉冲 ---- */
@keyframes msg-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.chat-send-btn.sent {
  animation: send-pulse 0.4s var(--ease-out);
}
@keyframes send-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.88);
  }
  100% {
    transform: scale(1);
  }
}
.moment-action svg.like-pop {
  animation: like-bounce 0.45s var(--ease-out);
}
@keyframes like-bounce {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

/* ---- 主按钮水波纹 ---- */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.38) 0%, transparent 55%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--dur-fast), transform var(--dur-slow) var(--ease-out);
}
.btn-primary.ripple::after {
  opacity: 1;
  transform: scale(2.2);
  transition: opacity var(--dur-normal), transform var(--dur-slow) var(--ease-out);
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* ---- 导航指示器 ---- */
.bottom-nav-indicator {
  position: absolute;
  top: 4px;
  left: var(--tab-indicator-left, 16.666%);
  width: 24px;
  margin-left: -12px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-primary);
  transition: left var(--dur-normal) var(--ease-out);
  pointer-events: none;
}
.nav-rail {
  position: relative;
}
.nav-rail-indicator {
  position: absolute;
  left: 8px;
  top: 0;
  width: 56px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  transition: transform var(--dur-normal) var(--ease-out), opacity var(--dur-fast);
  pointer-events: none;
  z-index: 0;
}
.nav-item {
  z-index: 1;
}
.nav-item-active {
  background: transparent;
}

/* ---- 头像选择器 ---- */
.create-presence {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.create-presence .avatar-picker {
  margin: 0;
  flex-shrink: 0;
}
.create-presence .avatar-picker-sub {
  display: none;
}
.create-presence-copy {
  min-width: 0;
  flex: 1;
  text-align: left;
}
.create-presence-name {
  font-size: var(--font-section);
  font-weight: var(--weight-semibold);
  font-style: normal;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
.create-presence-line {
  margin-top: 4px;
  font-size: var(--font-caption);
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.avatar-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 4px 0 16px;
}
.avatar-picker-btn {
  cursor: pointer;
  line-height: 0;
  border-radius: 50%;
}
.avatar-picker-btn .avatar,
.avatar-picker-btn .avatar-fallback {
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.avatar-picker-btn:hover .avatar,
.avatar-picker-btn:hover .avatar-fallback {
  transform: scale(1.03);
  box-shadow: 0 6px 20px color-mix(in oklab, var(--color-primary), transparent 78%);
}
.avatar-picker-hint {
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 500;
}
.avatar-picker-sub {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* ---- 创建角色卡片 ---- */
.create-sub {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}
.create-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.create-card {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast);
  animation: card-rise var(--dur-normal) var(--ease-out) both;
}
.create-card:nth-child(2) {
  animation-delay: 0.04s;
}
.create-card:nth-child(3) {
  animation-delay: 0.08s;
}
.create-card:nth-child(4) {
  animation-delay: 0.12s;
}
@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.create-card:hover,
.create-card-featured {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.create-card-featured {
  box-shadow: inset 3px 0 0 var(--color-primary);
}
.create-card:active {
  transform: scale(0.99);
}
.create-card-ic {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  display: grid;
  place-items: center;
  color: var(--color-primary);
  flex-shrink: 0;
}
.create-card-ic svg {
  width: 20px;
  height: 20px;
}
.create-card-title {
  font-weight: 600;
  font-size: 15px;
  display: block;
  color: var(--color-text);
  line-height: 1.35;
}
.create-card-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 6px;
  display: block;
  line-height: 1.5;
}
.create-primary-btn {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
  cursor: pointer;
  margin-bottom: 16px;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast);
}
.create-primary-btn:active {
  transform: scale(0.99);
}
.create-group-label {
  font-size: var(--font-label);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}
.create-secondary-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.create-secondary-btn {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .create-secondary-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-2);
  }
}
.create-secondary-btn .create-card-desc {
  margin-top: 4px;
}

/* ---- API 配置提示条 ---- */
.api-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-top: 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.45;
}
.link-btn {
  color: var(--color-primary);
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.composer-hint {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

/* ---- API 设置块 ---- */
.api-block {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-width: 0;
}
.api-block-ready {
  border-color: var(--color-mint);
  background: var(--color-mint-soft);
}
.api-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
}
.api-block-head h4 {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  line-height: 1.35;
}
.api-status {
  font-size: 11px;
  color: var(--color-text-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.api-block-ready .api-status {
  color: var(--color-text);
  background: var(--color-mint-soft);
  border-color: var(--color-mint);
}
.field-label {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin: 12px 0 8px;
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 520px) {
  .preset-grid {
    grid-template-columns: 1fr;
  }
}
.preset-card {
  text-align: left;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.preset-card:hover {
  border-color: var(--color-border-strong);
}
.preset-card.on {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--color-primary), transparent 70%);
}
.preset-card .pn {
  font-weight: 600;
  font-size: 14px;
  display: block;
}
.preset-card .pt {
  display: inline-block;
  font-size: 10px;
  color: var(--color-text-secondary);
  background: var(--color-surface-2);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  margin-top: 4px;
}
.preset-card .pnote {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 6px;
  line-height: 1.45;
  display: block;
  overflow-wrap: anywhere;
}
.api-hero {
  margin-bottom: 4px;
}
.api-hero .preset-card {
  width: 100%;
  cursor: default;
  border-color: var(--color-primary);
}
.key-steps {
  margin: 10px 0 4px;
  padding: 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.key-steps ol {
  padding-left: 18px;
  margin-top: 6px;
}
.key-steps li {
  margin-bottom: 4px;
}
.api-more-toggle {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 12px;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.api-more-toggle:hover {
  background: var(--color-surface-2);
}
.api-more-toggle .sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-secondary);
  min-width: 0;
  text-align: right;
}
.api-more {
  display: none;
  padding-top: 4px;
}
.api-more.open {
  display: block;
}

/* ---- 外观设置 ---- */
.theme-chip-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 520px) {
  .theme-grid {
    grid-template-columns: 1fr;
  }
}
.theme-swatch {
  text-align: left;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.theme-swatch.on {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--color-primary), transparent 70%);
}
.theme-swatch-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.theme-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.theme-swatch .tn {
  font-weight: 600;
  font-size: 13px;
}
.theme-bubbles {
  display: flex;
  gap: 4px;
}
.theme-bubbles span {
  height: 8px;
  border-radius: 4px;
  flex: 1;
}
.theme-preview {
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}
.theme-preview .tp-row {
  display: flex;
  margin-bottom: 6px;
}
.theme-preview .tp-b {
  max-width: 70%;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.4;
}
.theme-preview .tp-btn {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary-fg);
  margin-top: 4px;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.color-row label {
  font-size: 12px;
  color: var(--color-text-secondary);
  min-width: 76px;
}
.color-row input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  background: none;
}

/* ---- 导入向导 ---- */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 4px;
}
.mode-tab {
  flex: 1;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
.mode-tab.on {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}
.import-file-zone {
  display: block;
  width: 100%;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  background: var(--color-bg);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.import-file-zone:hover,
.import-file-zone.drag {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.import-file-zone .if-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  display: grid;
  place-items: center;
  color: var(--color-primary);
}
.import-file-zone .if-icon svg {
  width: 20px;
  height: 20px;
}
.import-file-zone .if-title {
  font-size: 14px;
  font-weight: 600;
}
.import-file-zone .if-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}
.wizard-loading {
  text-align: center;
  padding: 40px 20px;
}
.wizard-loading .spinner {
  margin: 0 auto 16px;
}
.wizard-loading h4 {
  font-size: 16px;
  margin-bottom: 6px;
}
.wizard-loading p {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.success-ripple {
  text-align: center;
  padding: 28px 20px;
}
.success-ripple .sr-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--color-primary), var(--color-mint));
  /* 标记本身保持实心，只让外圈涟漪扩散 */
  animation: sr-pulse 1.8s var(--ease-out) infinite;
}
@keyframes sr-pulse {
  0% {
    transform: scale(0.94);
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--color-primary), transparent 55%);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 18px color-mix(in oklab, var(--color-primary), transparent 100%);
  }
  100% {
    transform: scale(0.94);
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--color-primary), transparent 100%);
  }
}
.success-ripple h4 {
  font-size: 18px;
  margin-bottom: 6px;
}
.success-ripple p {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ---- 弹窗内滚动区 + 吸底操作栏 ---- */
.modal-split .modal-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-footer-sticky {
  position: sticky;
  bottom: 0;
}

/* ---- 消息头像与名字 ---- */
.msg-avatar-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
  flex-shrink: 0;
  align-self: flex-start;
  transition: transform var(--dur-fast) var(--ease-out);
}
.msg-avatar-btn:hover {
  transform: scale(1.04);
}
.msg-avatar-btn:active {
  transform: scale(0.96);
}
.msg-name {
  font-size: 12px;
  color: var(--color-text-tertiary);
  line-height: 1.3;
  padding: 0 2px;
  margin-bottom: 2px;
}
.msg-me .msg-name {
  text-align: right;
}
.msg-more-btn {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  align-self: center;
  opacity: 0.55;
  transition: opacity var(--dur-fast), background var(--dur-fast);
}
.msg-more-btn svg {
  width: 20px;
  height: 20px;
}
@media (hover: hover) and (pointer: fine) {
  .msg-more-btn {
    opacity: 0;
  }
  .msg:hover .msg-more-btn,
  .msg:focus-within .msg-more-btn,
  .msg.show-actions .msg-more-btn {
    opacity: 0.7;
  }
}
.msg-more-btn:hover,
.msg-more-btn:focus-visible {
  opacity: 1;
  background: var(--color-surface-2);
}
.msg.show-actions .msg-more-btn {
  opacity: 0.7;
}

/* ---- 瞬间：评论 ---- */
.moment-comments {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}
.moment-comment {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  line-height: 1.5;
}
.moment-comment b {
  color: var(--color-text);
  font-weight: 600;
}
.moment-comment-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  min-width: 0;
}
.moment-comment-row .input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
}

/* ---- 我的：资料卡 ---- */
.me-profile {
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.me-profile:active {
  transform: scale(0.99);
}
.me-profile-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.tab-enter .me-profile {
  animation: card-rise var(--dur-normal) var(--ease-out) both;
}

/* ---- 移动端：聊天滑入 + 抽屉遮罩 ---- */
@media (max-width: 767px) {
  .chat-pane {
    transform: translateX(0);
    animation: chat-slide-in var(--dur-normal) var(--ease-out) both;
  }
  @keyframes chat-slide-in {
    from {
      transform: translateX(12%);
      opacity: 0.4;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  .profile-mask {
    display: block;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .profile-mask {
    display: block;
  }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .profile-mask {
    display: block;
  }
}

/* ---- 桌面端：资料栏收起过渡 ---- */
@media (min-width: 1024px) {
  .profile-pane {
    transition: width var(--dur-slow) var(--ease-out), opacity var(--dur-normal) var(--ease-out);
  }
}

/* ---- 降低动效偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  .motion-enter,
  .motion-sheet,
  .motion-msg,
  .msg-appear .msg-bubble,
  .welcome-lead .lead-char,
  .welcome-screen h1,
  .welcome-actions,
  .welcome-beats,
  .welcome-letter,
  .modal,
  .modal-overlay,
  .drawer,
  .drawer-overlay,
  .profile-mask,
  .tab-enter .moment-entry {
    animation: none !important;
  }
  .ambient-layer {
    display: none;
  }
  .welcome-lead .lead-char,
  .welcome-screen h1,
  .welcome-actions,
  .welcome-beats,
  .welcome-letter {
    opacity: 1;
    transform: none;
  }
  .msg-streaming .msg-bubble::after {
    animation: none !important;
    opacity: 0.7;
  }
}
