﻿:root {
  color-scheme: light;
  --ink: #14161a;
  --muted: rgba(20, 22, 26, 0.56);
  --page: #061522;
  --glass: rgba(255, 255, 255, 0.26);
  --glass-line: rgba(255, 255, 255, 0.3);
  --danger: rgba(255, 69, 58, 0.82);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  background:
    radial-gradient(circle at 18% 20%, rgba(27, 111, 98, 0.84), transparent 28rem),
    radial-gradient(circle at 84% 24%, rgba(190, 116, 18, 0.92), transparent 22rem),
    radial-gradient(circle at 52% 58%, rgba(34, 59, 168, 0.9), transparent 26rem),
    linear-gradient(145deg, #061522 0%, #0d1428 58%, #2c1905 100%);
  background-attachment: fixed;
  overflow: hidden;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

button {
  font: inherit;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

[hidden] {
  display: none !important;
}

.app-frame {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  touch-action: none;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
}

.app-frame.is-elastic-releasing {
  transition: transform 240ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.privacy-segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.privacy-segment button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.privacy-segment button {
  min-height: 38px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 760;
}

.privacy-segment button.is-selected {
  background: rgba(255, 255, 255, 0.3);
}

.phone-find-toggle {
  width: fit-content;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  font-weight: 760;
}

.phone-find-toggle input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #fff;
}

.phone-find-toggle span {
  pointer-events: none;
}

.system-inline-page {
  width: 100%;
  padding: 0 18px 6px;
  position: relative;
}

body.phone-directory-page .system-inline-page {
  padding: 0;
  min-height: calc(100dvh - 200px);
}

.system-inline-page[hidden] {
  display: none;
}

.inline-system-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 26px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 18px 46px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(24px) saturate(145%);
}

.inline-system-hero {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 13px;
}

.inline-system-hero img {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.inline-system-hero div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.inline-system-hero span,
.inline-system-section h3 {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 780;
}

.inline-system-hero h2 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.inline-system-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.42;
}

.inline-system-section {
  display: grid;
  gap: 10px;
}

.inline-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.account-status-card {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.account-status-card strong {
  color: #fff;
  font-size: 15px;
  font-weight: 860;
}

.account-status-card span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 690;
  line-height: 1.36;
}

.inline-settings-grid button,
.inline-settings-grid a,
.inline-contact-chip,
.inline-result {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.inline-settings-grid button,
.inline-settings-grid a {
  min-height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.inline-toggle {
  min-height: 38px;
}

.inline-search-box {
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.18);
}

.inline-search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
}

.inline-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.54);
}

.inline-search-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.inline-contact-chip {
  min-width: 0;
  border-radius: 18px;
  padding: 9px 6px;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.inline-contact-chip img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.inline-contact-chip span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 780;
}

.inline-result-list {
  display: grid;
  gap: 8px;
}

.inline-result {
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 4px;
  text-align: left;
}

.inline-result strong {
  font-size: 14px;
  font-weight: 850;
}

.inline-result span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.34;
}

.inline-empty {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 720;
}

.edge-budget-card {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(16px) saturate(140%);
}

.edge-budget-card span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 760;
}

.edge-budget-card b {
  color: #fff;
  font-weight: 900;
}

.edge-budget-card small,
.edge-module-card small,
.edge-runtime-line {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
}

.edge-module-list {
  display: grid;
  gap: 8px;
}

.edge-demo-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.edge-demo-actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px) saturate(140%);
  font-size: 13px;
  font-weight: 820;
}

.edge-demo-actions button:active {
  transform: scale(0.97);
}

.edge-module-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 64px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.11);
}

.edge-module-card div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.edge-module-card strong,
.edge-module-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edge-module-card strong {
  color: #fff;
  font-size: 14px;
  font-weight: 880;
}

.edge-module-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.edge-module-card button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: #10151b;
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 880;
}

.edge-module-card button:disabled {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.16);
}

.edge-module-card.is-ready {
  border-color: rgba(117, 255, 191, 0.26);
  background: rgba(117, 255, 191, 0.1);
}

.edge-runtime-line {
  margin: 2px 0 0;
  padding: 0 2px;
}

.contact-rail {
  width: 100%;
  height: 136px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 8px calc((100% - 86px) / 2) 12px;
  background: transparent;
  transition: background 0.2s ease-out;
}

/* 固定在顶部状态（上滑时） */
.contact-rail.is-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
}

.contact-rail::-webkit-scrollbar {
  display: none;
}


.contact-card {
  width: 86px;
  min-width: 86px;
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  display: grid;
  justify-items: center;
  gap: 8px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transform: scale(var(--scale, 0.82));
  opacity: var(--opacity, 0.58);
  filter: blur(var(--blur, 0.6px));
  transform-origin: center center;
  transition: transform 160ms ease, opacity 160ms ease, color 160ms ease, filter 160ms ease;
  overflow: visible;
  position: relative;
}

.contact-card.ai-entry::after {
  content: "AI";
  position: absolute;
  top: 2px;
  right: 13px;
  min-width: 22px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(7, 19, 29, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.contact-card.has-unread::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 15px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(7, 18, 27, 0.88);
  background: #ff3347;
  box-shadow: 0 0 0 3px rgba(255, 51, 71, 0.18);
  z-index: 2;
}

.rail-follow-plus {
  position: absolute;
  top: 3px;
  left: 13px;
  z-index: 3;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid rgba(7, 18, 27, 0.84);
  color: #fff;
  background: #20c45a;
  box-shadow: 0 6px 16px rgba(32, 196, 90, 0.35);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.contact-card img {
  width: 56px;
  height: 56px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  transition: width 160ms ease, height 160ms ease, border-radius 160ms ease;
}

/* 选中时放大 */
.contact-card.is-active img {
  width: 72px;
  height: 72px;
}

/* 主页头像始终保持方形圆角 */
[data-role="settings"] img {
  border-radius: 14px !important;
}

/* 主页头像：首次使用前模糊处理，仅作用于主页头像，不影响其他头像 */
[data-role="settings"] img.home-avatar-blurred {
  filter: blur(6px);
  transform: scale(1.04); /* 略微放大遮盖模糊边缘溢出 */
}

/* 首次点击：模糊解除瞬间的"变清晰"动效 + 轻微缩放反馈 */
[data-role="settings"] img.home-avatar-revealing {
  animation: homeAvatarReveal 650ms ease forwards;
}
@keyframes homeAvatarReveal {
  0%   { filter: blur(6px); transform: scale(1.18); }
  55%  { filter: blur(1.5px); transform: scale(0.94); }
  100% { filter: blur(0); transform: scale(1); }
}

/* 自定义头像（群聊方形多头像 / 单聊首字母色块）也要跟随选中态缩放，保持与系统头像一致 */
.contact-card .group-avatar-grid,
.contact-card .contact-row-avatar {
  width: 56px;
  height: 56px;
  transition: width 160ms ease, height 160ms ease;
}
.contact-card.is-active .group-avatar-grid,
.contact-card.is-active .contact-row-avatar {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

/* ── 第三方 APP 快捷入口 ─────────────────────────────── */
.app-shortcuts {
  padding: 0 18px 12px;
}

.app-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.app-shortcut-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 760;
  transition: transform 120ms ease, background 120ms ease;
}

.app-shortcut-item:active {
  transform: scale(0.94);
}

.app-shortcut-item img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.app-shortcut-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 760;
}

/* 已绑定小绿点 */
.app-bound-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4fffb0;
  box-shadow: 0 0 6px rgba(79, 255, 176, 0.7);
  font-style: normal;
}

/* 添加按钮 */
.app-shortcut-add {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.app-shortcut-add-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px dashed rgba(255, 255, 255, 0.36);
  display: grid;
  place-items: center;
  font-size: 26px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
}

/* ─────────────────────────────────────────────────── */

/* ── 联系人页面 ───────────────────────────────────────────── */
.contacts-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 4px 0 0;
}

.contacts-search-bar {
  padding: 12px 18px 28px;
  flex-shrink: 0;
}

.contacts-search-bar input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 640;
  outline: none;
  transition: all 0.2s;
}

.contacts-search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.contacts-search-bar input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.contacts-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-result-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.search-result-item strong {
  display: block;
  font-size: 15px;
  font-weight: 880;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 4px;
}

.search-result-item small {
  display: block;
  font-size: 13px;
  font-weight: 640;
  color: rgba(255, 255, 255, 0.6);
}

.search-result-source {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(102, 126, 234, 0.2);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 720;
  color: rgba(102, 126, 234, 1);
  margin-top: 6px;
}

.contacts-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 12px;
  flex-shrink: 0;
}

.contacts-tab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 760;
}

.contacts-tab.is-active {
  background: rgba(255,255,255,0.92);
  color: #07131d;
  border-color: transparent;
}

.create-topic-button {
  margin-left: auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.26);
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 13px;
  font-weight: 780;
  white-space: nowrap;
}

.add-friend-button {
  width: 30px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.26);
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 16px;
  font-weight: 780;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.add-friend-button:active {
  background: rgba(255,255,255,0.24);
}

.contacts-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px 16px;
}

.contacts-empty {
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  padding: 40px 0;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(7,19,29,0.001); /* 让滑动捕获生效但视觉不变 */
  text-align: left;
  width: 100%;
  position: relative;
  z-index: 2;
  transform: translateX(var(--row-swipe-x, 0px));
  transition: transform 160ms ease;
  touch-action: pan-y;
}
.contact-row-wrap.is-dragging .contact-row {
  transition: none;
}
.contact-row:active { background: rgba(255,255,255,0.08); }

.contact-row-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}
.contact-row-wrap.is-removing {
  animation: contactRowRemove 220ms ease forwards;
}
@keyframes contactRowRemove {
  to { opacity: 0; transform: scaleY(0.4); height: 0; margin: 0; }
}

.contact-row-hint {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  z-index: 1;
  cursor: pointer;
}
.hint-profile {
  left: 0;
  background: linear-gradient(90deg, #1B6F62, transparent);
  opacity: var(--hint-profile-opacity, 0);
}
.hint-delete {
  right: 0;
  background: linear-gradient(270deg, #c0392b, transparent);
  justify-content: flex-end;
  opacity: var(--hint-delete-opacity, 0);
}

.contact-row-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 880;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.contact-row-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.contact-row-info strong {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}
.contact-row-info small {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

.contact-row-chevron {
  color: rgba(255,255,255,0.35);
  font-size: 18px;
}

/* ── 创建话题 / 添加成员 弹窗：固定在视口中央
   用 inset:0 + margin:auto 居中，避免 transform 在 iOS Safari 上引起内容截断 ── */
.create-topic-page {
  position: fixed;
  inset: 0;
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 22px;
  padding: 0;
  width: min(390px, calc(100vw - 34px));
  max-height: min(640px, calc(100vh - 64px));
  max-height: min(640px, calc(100dvh - 64px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  /* 比原来（0.96）明显更浅更透明，同时深色足够保证文字对比度不丢失 */
  background: rgba(16, 32, 48, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 24px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  color: #fff;
}

.create-topic-page:not([open]),
.create-topic-page[hidden] {
  display: none;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.create-topic-page::backdrop {
  background: rgba(4, 9, 16, 0.42);
  backdrop-filter: blur(10px);
}

/* 拉长弹出节奏，跟项目里其他弹窗（如绑定账号）保持同一种柔和过渡感，
   但时长翻倍以上，避免"弹出过快、观感生硬"。 */
.create-topic-page[open] {
  display: flex;
  animation: dialog-fade-in-slow 220ms ease both;
}

@keyframes dialog-fade-in-slow {
  from {
    opacity: 0;
    filter: blur(8px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

.create-topic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  flex-shrink: 0;
}
.create-topic-header span {
  font-size: 15px;
  font-weight: 880;
  color: #fff;
}
.create-topic-header button {
  font-size: 14px;
  font-weight: 780;
  color: rgba(255,255,255,0.7);
  background: none;
  border: none;
  padding: 4px 6px;
}
#finishTopicButton {
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.32);
  font-weight: 800;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}
#finishTopicButton.is-ready {
  background: #1aad19;
  color: #fff;
  font-weight: 880;
  box-shadow: 0 6px 16px rgba(26,173,25,0.4);
}
#finishTopicButton.is-ready:active {
  transform: scale(0.95);
}

.create-topic-input {
  margin: 6px 18px 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  cursor: text;
}
.create-topic-input span {
  font-size: 13.5px;
  color: rgba(255,255,255,0.55);
}
.create-topic-input input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
}
.create-topic-input input::placeholder {
  color: rgba(255,255,255,0.4);
}

.create-topic-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* iOS 安全区底部适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .create-topic-list {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

.topic-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 14px;
  background: transparent;
  text-align: left;
}
.topic-contact-row:active { background: rgba(255,255,255,0.08); }

.topic-select-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.35);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, border-color 120ms ease;
}
.topic-contact-row.is-selected .topic-select-circle {
  background: #1aad19;
  border-color: #1aad19;
}
.topic-contact-row.is-selected .topic-select-circle::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

/* ── 群聊方形头像（最多4格） ──────────────────────────────── */
.group-avatar-grid {
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  background: rgba(255,255,255,0.08);
}
.group-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 880;
  color: #fff;
}
.group-cell-empty {
  background: rgba(255,255,255,0.06);
}
.group-cell-count {
  background: rgba(255,255,255,0.22);
  font-size: 15px;
}

/* ── "创建AI应用"页面（复刻豆包App创建智能体表单） ──────────────── */
/* 整体去掉容器背景/边框，内容直接铺在页面背景上，靠分隔线和间距区分层次 */
.create-app-page {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
}

.create-app-avatar-zone {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 4px 4px 14px;
}
.create-app-avatar-slot {
  justify-self: center;
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.create-app-avatar-slot.has-image {
  background: none;
}
.create-app-avatar-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.create-app-avatar-face {
  font-size: 22px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 4px;
}
.create-app-avatar-plus {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1f6fff;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* 单行字段（名称、声音、建议回复开关）：无背景，靠底部分隔线区分 */
.create-app-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.create-app-row-label {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.create-app-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}
.create-app-input::placeholder {
  color: rgba(255,255,255,0.4);
}

/* 多行字段块（设定描述、介绍、开场白、可见范围）：无背景，靠底部分隔线区分 */
.create-app-field-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.create-app-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.create-app-textarea {
  width: 100%;
  min-height: 70px;
  background: none;
  border: none;
  outline: none;
  resize: none;
  color: #fff;
  font-size: 13.5px;
  font-weight: 640;
  line-height: 1.5;
  font-family: inherit;
}
.create-app-textarea-small {
  min-height: 44px;
}
.create-app-textarea::placeholder {
  color: rgba(255,255,255,0.38);
}
.create-app-preview-button {
  font-size: 12px;
  font-weight: 760;
  color: rgba(255,255,255,0.6);
  background: none;
  border: none;
  white-space: nowrap;
}

/* 声音：男声/女声 二选一胶囊按钮 */
.create-app-gender-options {
  display: flex;
  gap: 8px;
}
.create-app-gender-button {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 760;
}
.create-app-gender-button.is-selected {
  background: rgba(31,111,255,0.3);
  border-color: rgba(31,111,255,0.6);
  color: #fff;
}

/* 可见范围：三选一胶囊按钮，默认所有人可见 */
.create-app-visibility-options {
  display: flex;
  gap: 8px;
}
.create-app-visibility-button {
  flex: 1;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 720;
}
.create-app-visibility-button.is-selected {
  border-color: rgba(26,173,25,0.55);
  background: rgba(26,173,25,0.18);
  color: #fff;
}

.create-app-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 0 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 13.5px;
  font-weight: 760;
}
.create-app-advanced-icon {
  font-size: 15px;
  font-weight: 900;
}

.create-app-advanced-body {
  display: flex;
  flex-direction: column;
}
.create-app-advanced-body[hidden] {
  display: none;
}

/* 创建AI应用：取消/完成 按钮，现位于头像左右两侧 */
.create-app-cancel-button {
  justify-self: start;
  font-size: 14px;
  font-weight: 720;
  color: rgba(255,255,255,0.65);
  background: none;
  border: none;
  padding: 8px 4px;
}
.create-app-finish-button {
  justify-self: end;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.35);
  font-size: 14px;
  font-weight: 800;
  border: none;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.create-app-finish-button.is-ready {
  background: #1aad19;
  color: #fff;
  box-shadow: 0 6px 16px rgba(26,173,25,0.4);
}
.create-app-finish-button.is-ready:active {
  transform: scale(0.95);
}

/* 已创建 AI 应用聊天页右上角动作：和左侧清空/加人小圆按钮分离 */
.toolbar-created-app-actions {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.toolbar-edit-button {
  pointer-events: auto;
  min-width: 54px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(8, 16, 24, 0.28);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.toolbar-invite-button {
  border-color: rgba(79, 255, 176, 0.32);
  background: rgba(32, 196, 90, 0.2);
}

/* 乐包聊天页右上角"约会乐包"按钮 */
.date-agent-button {
  pointer-events: auto;
  margin-left: auto;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,138,80,0.5);
  background: rgba(255,138,80,0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.date-agent-button:active {
  transform: scale(0.95);
}

/* 约会乐包：内嵌网页弹层（占位实现，模拟"打开豆包"体验；未来做成App后应换成系统级跳转） */
/* 约会乐包：半透明"假加载"过渡遮罩（不加载任何真实网页，只是视觉过渡） */
.date-agent-embed-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}
.date-agent-embed-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.date-agent-embed-content p {
  color: #fff;
  font-size: 14px;
  font-weight: 760;
  margin: 0;
}
.date-agent-embed-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: dateAgentSpin 800ms linear infinite;
}
@keyframes dateAgentSpin {
  to { transform: rotate(360deg); }
}

/* 联系人轨道：新创建AI应用的空头像占位（没上传图就留白方块/圆形） */
.created-app-avatar-empty {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px dashed rgba(255,255,255,0.28);
}
.contact-card.is-active .created-app-avatar-empty {
  width: 72px;
  height: 72px;
}

/* 已创建AI应用的聊天页头部：设定描述 + 编辑入口 */
.created-app-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.created-app-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.created-app-edit-button {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.26);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  flex-shrink: 0;
}
.created-app-invite-button {
  max-width: 118px;
  padding-left: 12px;
  padding-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 建议回复：开关 + 提示文字 + 三条输入框 */
.create-app-suggested-reply-zone {
  display: flex;
  flex-direction: column;
}
.create-app-suggested-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin: 0 4px 4px;
}
.create-app-toggle-switch {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  border: none;
  flex-shrink: 0;
  transition: background 160ms ease;
}
.create-app-toggle-switch.is-on {
  background: #1aad19;
}
.create-app-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 160ms ease;
}
.create-app-toggle-switch.is-on .create-app-toggle-knob {
  transform: translateX(19px);
}
.create-app-suggested-inputs {
  display: flex;
  flex-direction: column;
}
.create-app-suggested-inputs[hidden] {
  display: none;
}
.create-app-suggested-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  font-weight: 640;
}
.create-app-suggested-input::placeholder {
  color: rgba(255,255,255,0.4);
}
.create-app-suggested-input:last-child {
  border-bottom: none;
}

/* ── "我"页面：顶部公开展示容器（头像/名称只读 + Slogan/爱心号可编辑） ── */
.profile-public-card {
  margin: 10px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-public-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-avatar-slot {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
  border: 1.5px dashed rgba(255,255,255,0.32);
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}
.profile-avatar-slot.has-image {
  border-style: solid;
  border-color: transparent;
}
.profile-avatar-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-slot-hint {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  color: rgba(255,255,255,0.45);
  text-align: center;
}
.profile-name-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 880;
  color: #fff;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}
.profile-name-input::placeholder {
  color: rgba(255,255,255,0.4);
  font-weight: 700;
}
.profile-public-fields {
  display: flex;
  flex-direction: column;
}

/* ── "我"页面：个人设置/系统设置 竖排折叠按钮，按钮下面紧跟对应内容 ── */
.profile-section-toggle {
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.16);
  border: 1.5px solid rgba(255,255,255,0.26);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 880;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.profile-section-toggle:active {
  transform: scale(0.97);
}
.profile-section-toggle[aria-expanded="true"] {
  background: rgba(255,255,255,0.24);
  border-color: rgba(255,255,255,0.4);
}
.profile-toggle-chevron {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
}

/* 折叠内容：不再套卡片外框，直接平铺，节省小屏幕空间 */
.profile-section-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
.profile-section-body[hidden] {
  display: none;
}

.profile-field-group {
  display: flex;
  flex-direction: column;
}

.profile-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  width: 100%;
  background: none;
  text-align: left;
}

.profile-field-label {
  font-size: 14px;
  font-weight: 760;
  color: rgba(255,255,255,0.88);
  flex-shrink: 0;
}

.profile-field-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.profile-field-input {
  width: 100%;
  text-align: right;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.profile-field-input::placeholder {
  color: rgba(255,255,255,0.36);
  font-weight: 600;
}

.profile-field-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 18px;
  background:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.72) 50%) right 7px center / 6px 6px no-repeat,
    linear-gradient(135deg, rgba(255,255,255,0.72) 50%, transparent 50%) right 2px center / 6px 6px no-repeat;
}

.profile-field-select option {
  color: #111;
  background: #fff;
}

.profile-field-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.profile-field-chevron {
  color: rgba(255,255,255,0.36);
  font-size: 17px;
}

.profile-visibility-group {
  padding: 4px 4px 2px;
}
.profile-visibility-title {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0 4px;
}
.profile-visibility-options {
  display: flex;
  gap: 10px;
}
.profile-visibility-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  font-size: 13px;
  font-weight: 720;
  color: rgba(255,255,255,0.78);
  cursor: pointer;
}
.profile-visibility-option input {
  accent-color: #1aad19;
  margin: 0;
}
.profile-visibility-option:has(input:checked) {
  border-color: rgba(26,173,25,0.55);
  background: rgba(26,173,25,0.16);
  color: #fff;
}

/* ── 系统搜索页顶部文字输入框 ─────────────────────────────── */
.inline-search-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
}
.inline-search-icon {
  font-size: 14px;
  opacity: 0.7;
}
.inline-search-topbar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.inline-search-topbar input::placeholder {
  color: rgba(255,255,255,0.45);
}

/* 小心主持消息按普通透明聊天气泡展示，不再使用独立卡片壳。 */
.host-plain-message .chat-bubble-wrap p {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ── 群聊聊天页头部 ───────────────────────────────────────── */
.group-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: -8px 0 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
}
.group-chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.group-chat-header-info strong {
  font-size: 15px;
  font-weight: 880;
  color: #fff;
}
.group-chat-header-info small {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 话题已结束：聊天消息区域换成这条提示，不再展示历史聊天气泡 */
.topic-ended-notice {
  margin: 60px 24px 0;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}

.system-archive-message {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  padding: 0 16px;
}
.system-archive-text {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.contact-card span {
  max-width: 86px;
  min-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
}

.contact-card.is-active {
  color: #fff;
  filter: blur(0);
}

.contact-card.is-active span {
  font-size: 14px;
  font-weight: 880;
}

.contact-card.system-contact img {
  background: rgba(255, 255, 255, 0.92);
  padding: 5px;
}

.contact-card.system-shortcut img {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.surface-toolbar {
  width: 100%;
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  position: relative;
  z-index: 4;
}

body.search-page .surface-toolbar {
  height: 44px;
  min-height: 44px;
  padding: 0 18px 0 58px;
  pointer-events: auto;
}

/* ── 系统搜索：工具栏输入框（与清空按钮平行） ─────────────────────── */
.search-toolbar-input-wrap {
  flex: 0 1 300px;
  max-width: calc(100% - 12px);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(18px) saturate(150%);
  pointer-events: auto;
}
.search-toolbar-icon {
  font-size: 13px;
  opacity: 0.7;
}
.search-toolbar-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
}
.search-toolbar-input-wrap input::placeholder {
  color: rgba(255,255,255,0.42);
}

/* ── 系统搜索：结果二级页面 ───────────────────────────────────── */
.search-results-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 4px;
}
.search-empty-hint {
  text-align: center;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  padding: 40px 20px;
  margin: 0;
}
.search-result-group {
  display: flex;
  flex-direction: column;
}
.search-result-group-title {
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,0.5);
  margin: 0 4px 6px;
}
.search-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  width: 100%;
  background: none;
  text-align: left;
}
.search-result-row:last-child {
  border-bottom: none;
}
.search-result-row:active {
  background: rgba(255,255,255,0.06);
}

.notification-area {
  width: 100%;
  padding: 0 18px;
  overflow: hidden;
}

.clear-all-button {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(8, 16, 24, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.14);
  font-size: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.clear-all-button:active {
  transform: scale(0.94);
}

/* 滚动历史消息按钮：工具栏水平居中，避开左侧圆形按钮和右侧文字按钮 */
.toolbar-scroll-btn {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(8, 16, 24, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.14);
  font-size: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  touch-action: none;
}
.toolbar-scroll-btn[hidden] { display: none; }
.toolbar-scroll-btn:active { transform: scale(0.94); }

.clear-all-button.is-exit-button {
  color: #ff8a80;
  border-color: rgba(255, 138, 128, 0.4);
  background: rgba(95, 30, 28, 0.3);
}

/* +加人按钮：常驻在"清空消息/退出聊天"按钮右侧，同一排左上角。
   四个按钮（清除/加人/退出/结束话题）每页最多同时显示两到三个，
   具体显示哪些、谁在前谁在后，由 JS 的 layoutToolbarButtons() 统一计算 left 值。 */
.add-member-button {
  position: absolute;
  top: 8px;
  left: 48px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(8, 16, 24, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.14);
  font-size: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}
.add-member-button:active {
  transform: scale(0.94);
}

.exit-chat-button {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 138, 128, 0.4);
  border-radius: 50%;
  color: #ff8a80;
  background: rgba(95, 30, 28, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.14);
  font-size: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}
.exit-chat-button:active {
  transform: scale(0.94);
}

.end-topic-toolbar-button {
  position: absolute;
  top: 10px;
  right: 12px;
  left: auto;
  z-index: 4;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  pointer-events: auto;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}
.end-topic-toolbar-button.is-ended {
  background: rgba(26, 173, 25, 0.18);
  border-color: rgba(26, 173, 25, 0.4);
}
.end-topic-toolbar-button:active {
  transform: scale(0.96);
}

.profile-save-button {
  flex-shrink: 0;
  min-width: 62px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.96);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 24px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  font-size: 13px;
  font-weight: 880;
}

.profile-save-button:active {
  transform: scale(0.96);
}

.profile-protect-button {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px) saturate(150%);
  font-size: 12px;
  font-weight: 820;
}

.profile-protect-button:active {
  transform: scale(0.96);
}

.message-list {
  display: grid;
  gap: 10px;
  min-height: 332px;
  max-height: 332px;
  overflow: hidden;
  touch-action: none;
  align-content: end;
  mask-image: linear-gradient(180deg, transparent 0, #000 8px, #000 100%);
}

.message-row {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  border-radius: 24px;
  touch-action: pan-y;
}

.delete-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 69, 58, 0.54) 48%, var(--danger) 100%);
  opacity: var(--delete-opacity, 0);
  transform: translateX(var(--delete-shift, 16px));
  transition: opacity 180ms ease, transform 180ms ease;
}

.delete-backdrop span {
  width: 96px;
  display: grid;
  place-items: center;
  padding-top: 42px;
  color: rgba(255, 255, 255, 0.96);
  font-size: 16px;
  font-weight: 820;
}

.message-card {
  position: relative;
  min-height: 104px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--glass-line);
  border-radius: inherit;
  color: #fff;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 18px 46px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(24px) saturate(145%);
  transform: translateX(var(--swipe-x, 0px));
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease;
  will-change: transform;
}

.message-row.is-dragging .message-card,
.message-row.is-dragging .delete-backdrop {
  transition: none;
}

.message-row.is-removing .message-card {
  opacity: 0;
  transform: translateX(-112%);
}

.message-row.is-removing .delete-backdrop {
  opacity: 0;
  display: none;
}

.message-row.is-removing {
  animation: collapse-row 220ms ease 170ms forwards;
}

.message-row.is-new {
  animation: reveal-row 220ms ease both;
}

.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.message-copy {
  min-width: 0;
}

.message-topline {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.message-topline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 860;
}

.message-topline time {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.message-copy p {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  font-weight: 690;
  line-height: 1.24;
}

@keyframes collapse-row {
  to {
    min-height: 0;
    height: 0;
    margin-top: -10px;
    opacity: 0;
  }
}

@keyframes reveal-row {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 聊天区域滚动控制：定位在 chat-area-wrap 内顶部居中 ── */
.chat-area-wrap {
  position: relative;
}

.chat-scroll-btn:active {
  transform: scale(0.9);
}

.chat-area {
  position: relative;
  display: grid;
  gap: 12px;
  height: auto;
  min-height: calc(100vh - 136px - 110px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  max-height: none;
  overflow: visible;
  align-content: end;
  padding: 0 18px 18px 18px;
  margin-bottom: calc(110px + env(safe-area-inset-bottom));
  scrollbar-width: none;
  touch-action: pan-y;
  overscroll-behavior: auto;
  mask-image: linear-gradient(180deg, transparent 0, #000 8px, #000 100%);
}

body.phone-directory-page .chat-area {
  isolation: isolate;
}

/* 主页聊天背景图：默认完全透明，AI 回复并朗读时逐渐显现 */
.home-chat-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("./assets/home-chat-bg.png");
  background-size: min(92vw, 396px) auto;
  background-repeat: no-repeat;
  background-position: center 120px;
  opacity: 0;
  transition: opacity 4200ms ease;
}
.home-chat-bg.is-visible {
  animation: chatBgBreathe 8000ms ease-in-out infinite;
}

/* 乐包聊天背景图：默认完全透明，AI 回复并朗读时逐渐显现 */
.agent-chat-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("./assets/agent-chat-bg.png");
  background-size: min(92vw, 396px) auto;
  background-repeat: no-repeat;
  background-position: center 120px;
  opacity: 0;
  transition: opacity 4200ms ease;
}
.agent-chat-bg.is-visible {
  animation: chatBgBreathe 8000ms ease-in-out infinite;
}

/* 通用"呼吸/心跳"动效：背景图缩放和位置做极轻微的周期性变化，
   适用于所有聊天背景图（主页、乐包，未来新增的背景图也直接复用这个动画即可） */
@keyframes chatBgBreathe {
  0%,100% { opacity: 0.1; transform: scale(1)     translateY(0px); }
  50%     { opacity: 1;   transform: scale(1.025) translateY(-3px); }
}

/* 聊天气泡需要在背景图之上 */
.chat-area .chat-message,
.chat-area .group-chat-header,
.chat-area .inline-search-topbar {
  position: relative;
  z-index: 1;
}

.chat-area[hidden],
.notification-area[hidden] {
  display: none;
}

.chat-message {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.phone-directory-background {
  position: absolute;
  inset: 8px 22px;
  z-index: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  pointer-events: none;
  opacity: 0.24;
  filter: blur(0.2px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.18));
}

.phone-directory-background span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 760;
}

.phone-directory-background b {
  min-width: 38px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 900;
}

.chat-side-tools {
  width: 34px;
  min-width: 34px;
  display: grid;
  justify-items: center;
  gap: 5px;
}

.chat-message p {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.94);
  background: transparent;
  backdrop-filter: blur(20px) saturate(140%);
  font-size: 15px;
  font-weight: 680;
  line-height: 1.32;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-message.incoming p {
  border-color: rgba(255, 255, 255, 0.5);
  background: transparent;
  backdrop-filter: none;
}

.chat-message.outgoing p {
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.34);
}

.system-chat-card {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 9px;
  padding: 14px 16px;
}

.system-chat-card.outgoing {
  justify-content: flex-end;
  align-items: flex-end;
}

.system-chat-card p {
  max-width: 100%;
  margin: 0;
  padding: 3px 0 0;
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.94);
  background: transparent;
  backdrop-filter: none;
  font-size: 15px;
  font-weight: 690;
  line-height: 1.28;
}

.system-chat-card.outgoing p {
  max-width: 100%;
  color: rgba(255, 255, 255, 0.94);
  background: transparent;
}

.chat-bubble-wrap {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 43px);
  display: block;
}

.chat-bubble-wrap p {
  max-width: 100%;
}

.voice-speaker-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 14px;
  display: grid;
  place-items: center;
  backdrop-filter: blur(12px);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.voice-speaker-button.is-playing {
  background: rgba(26, 173, 25, 0.32);
  border-color: rgba(26, 173, 25, 0.55);
  box-shadow: 0 0 0 4px rgba(26, 173, 25, 0.12);
}
.voice-speaker-button.is-muted {
  opacity: 0.58;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  filter: grayscale(1);
}
.voice-speaker-button:active {
  transform: scale(0.92);
}

/* 播放原声按钮▶：接收方在 chat-side-tools，发送方在 voice-duration-bar 内 */
.voice-play-original-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 11px;
  display: grid;
  place-items: center;
  backdrop-filter: blur(12px);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.voice-play-original-button:active {
  transform: scale(0.92);
}

.voice-message-wrap {
  display: grid;
  gap: 6px;
  width: min(100%, 300px);
}

/* 时长条：仅发送方气泡内有（接收方按钮已移至 chat-side-tools） */
.voice-duration-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.voice-message-audio {
  display: none;
}

/* 气泡内的长文本折叠：文字和箭头同属一个气泡 */
.voice-text-block {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.voice-bubble-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.voice-text-block.is-expanded .voice-bubble-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}


.voice-translation-speaker {
  width: 26px;
  height: 26px;
  min-width: 26px;
  font-size: 12px;
  flex-shrink: 0;
}

.chat-message.outgoing {
  justify-content: flex-end;
  align-items: flex-end;
}

.chat-message.outgoing p {
  max-width: 82%;
}

.digital-human-panel {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 16px 36px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(22px) saturate(145%);
}

.digital-human-preview {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.digital-human-preview img {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.digital-human-panel.is-speaking .digital-human-preview img {
  animation: digital-human-speaking 520ms ease-in-out infinite;
  box-shadow:
    0 0 0 8px rgba(95, 198, 255, 0.14),
    0 0 34px rgba(95, 198, 255, 0.48),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

.digital-human-preview span,
.digital-human-copy small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.digital-human-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.digital-human-copy strong {
  font-size: 16px;
  font-weight: 880;
}

.digital-human-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.34;
}

.digital-human-copy small {
  text-align: left;
}

.digital-human-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.digital-human-actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 820;
}

.chat-message.voice p {
  min-width: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invite-message-actions {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.invite-message-actions button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 820;
}

.invite-message-actions button:first-child {
  background: rgba(26, 173, 25, 0.78);
  border-color: rgba(26, 173, 25, 0.88);
}

.invite-message-status {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 760;
}

.composer-area {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  width: min(100%, 430px);
  min-height: calc(110px + env(safe-area-inset-bottom));
  padding: 5px 18px max(5px, env(safe-area-inset-bottom));
  overflow: visible;
  pointer-events: auto;
  touch-action: none;
  background: transparent;
}

.record-glow {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
  width: 160px;
  height: 120px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) scale(0.72);
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 62%, rgba(75, 172, 255, 0.72) 0%, rgba(75, 172, 255, 0.3) 42%, transparent 74%);
  filter: blur(2px);
  transition: opacity 180ms ease, transform 260ms ease;
}

.composer-area.is-recording .record-glow {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: recording-pulse 1150ms ease-in-out infinite;
}

.record-hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translate(-50%, 18px);
  min-width: 164px;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(0, 0, 0, 0.22);
  opacity: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 760;
  backdrop-filter: blur(18px) saturate(140%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.composer-area.is-recording .record-hint,
.composer-area.show-hint .record-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.bottom-input-bar {
  position: relative;
  z-index: 2;
  min-height: 90px;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: end;
  gap: 18px;
  pointer-events: auto;
  touch-action: none;
}

.bottom-icon-button,
.voice-home-button {
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px) saturate(120%);
}

.bottom-icon-button {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 900;
}

.voice-home-button {
  width: 94px;
  height: 94px;
  justify-self: center;
  display: grid;
  place-items: center;
  border-width: 2px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 880;
  letter-spacing: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.voice-home-button span {
  max-width: 54px;
  line-height: 1.16;
  text-align: center;
}

.composer-area.is-recording .voice-home-button {
  border-color: rgba(130, 210, 255, 0.9);
  color: #fff;
  background: rgba(80, 176, 255, 0.12);
  box-shadow:
    0 0 0 10px rgba(72, 164, 255, 0.16),
    0 0 32px rgba(72, 164, 255, 0.58),
    inset 0 0 22px rgba(116, 204, 255, 0.22);
}

.text-composer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 3;
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr 46px;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 18px 46px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(26px) saturate(150%);
  pointer-events: auto;
}

.text-composer[hidden] {
  display: none;
}

#messageInput {
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-size: 15px;
  font-weight: 680;
  padding: 0 10px;
}

#messageInput::placeholder {
  color: rgba(255, 255, 255, 0.74);
}

#sendTextButton {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: #0a1a24;
  background: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  font-weight: 900;
}

.dynamic-area {
  padding: 18px 18px 4px;
}

.dynamic-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  background: transparent;
}

.dynamic-area h2 {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 780;
  letter-spacing: 0;
  background: transparent;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.32);
}

.dynamic-heading h2 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-dynamic-button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.38), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 12px 28px rgba(0, 0, 0, 0.18);
  font-size: 27px;
  line-height: 1;
  backdrop-filter: blur(22px) saturate(170%);
}

.add-dynamic-button:active {
  transform: scale(0.94);
}

.dynamic-area.is-readonly .add-dynamic-button {
  display: none;
}

.dynamic-card {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  position: relative;
  display: block;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 18px 46px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px) saturate(145%);
}

.dynamic-card.is-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.24), transparent 28%),
    rgba(255, 255, 255, 0.12);
}

.dynamic-card.is-placeholder::before {
  content: "";
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 38%, rgba(255, 255, 255, 0.9) 38% 62%, transparent 62%),
    rgba(255, 255, 255, 0.12);
  clip-path: polygon(32% 24%, 32% 76%, 76% 50%);
  opacity: 0.9;
}

.dynamic-card img,
.dynamic-card video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dynamic-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.54), transparent);
}

.dynamic-card span {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 18px;
  font-weight: 860;
}

.dynamic-detail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 70;
  display: grid;
  place-items: center;
  width: min(100%, 430px);
  padding: 0;
  opacity: var(--detail-opacity, 1);
  transform: translate(calc(-50% + var(--detail-x, 0px)), var(--detail-y, 0px));
  background: #05090f;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease;
}

.dynamic-detail[hidden] {
  display: none;
}

.dynamic-detail.is-dragging {
  transition: none;
}

.dynamic-stage {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #05090f;
  box-shadow: none;
  touch-action: none;
}

.dynamic-detail-action-slot {
  position: absolute;
  left: 16px;
  top: max(14px, env(safe-area-inset-top));
  z-index: 92;
}

.dynamic-delete-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 90, 90, 0.45);
  border-radius: 50%;
  color: #ff8a80;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 12px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px) saturate(130%);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  padding-bottom: 2px;
}
.dynamic-delete-button:active {
  transform: scale(0.92);
}

.dynamic-detail[hidden] .dynamic-detail-action-slot {
  display: none;
}

.dynamic-slide {
  width: 100%;
  height: 100%;
  position: relative;
  margin: 0;
  color: #fff;
}

.dynamic-slide img,
.dynamic-slide video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dynamic-slide video {
  background: #05090f;
}

.dynamic-slide::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent);
}

/* ── 聊天总结专属全屏卡片 ───────────────────────────────── */
.dynamic-summary-card {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: linear-gradient(170deg, rgba(4, 10, 18, 0.98) 0%, rgba(8, 18, 30, 0.98) 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dynamic-summary-card[hidden] { display: none; }

.dynamic-summary-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(52px, calc(40px + env(safe-area-inset-top))) 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.dynamic-summary-title {
  font-size: 15px;
  font-weight: 840;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.78);
  text-transform: none;
}

/* 正文区：默认完整展示（短文本不折叠） */
.dynamic-summary-body {
  flex: 1;
  min-height: 0;
  padding: 22px 24px 10px;
  font-size: 15px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.88);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* 折叠态：截断 + 渐隐遮罩，不可滚动 */
.dynamic-summary-body.is-collapsed {
  overflow: hidden;
  max-height: 52vh;
  -webkit-mask-image: linear-gradient(to bottom, black 52%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 52%, transparent 100%);
}

/* 展开态：取消截断，恢复滚动 */
.dynamic-summary-body.is-expanded {
  max-height: none;
  -webkit-mask-image: none;
  mask-image: none;
}

/* 展开/收起按钮：固定在卡片底部 */
.dynamic-summary-expand-btn {
  flex-shrink: 0;
  width: 100%;
  padding: 13px 20px;
  padding-bottom: max(13px, calc(10px + env(safe-area-inset-bottom)));
  background: rgba(4, 10, 18, 0.95);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.52);
  font-size: 13.5px;
  font-weight: 720;
  letter-spacing: 0.5px;
  text-align: center;
  cursor: pointer;
  transition: color 140ms ease;
}
.dynamic-summary-expand-btn[hidden] { display: none; }
.dynamic-summary-expand-btn:active { color: rgba(255, 255, 255, 0.88); }

.dynamic-slide-copy {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(132px + env(safe-area-inset-bottom));
  z-index: 1;
  display: grid;
  gap: 5px;
}

.dynamic-actions {
  position: absolute;
  right: 10px;
  top: 44%;
  z-index: 2;
  display: grid;
  gap: 14px;
  transform: translateY(-50%);
}

.dynamic-actions button {
  width: 50px;
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.dynamic-actions span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(12px) saturate(140%);
  font-size: 24px;
  font-weight: 840;
}

.dynamic-actions small {
  font-size: 12px;
  font-weight: 760;
}

.dynamic-slide-copy strong {
  font-size: 22px;
  font-weight: 880;
}

.dynamic-slide-copy span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 720;
}

.add-dynamic-dialog {
  width: min(88vw, 360px);
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
}

.add-dynamic-dialog::backdrop {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.add-dynamic-dialog[open] {
  animation: dialog-fade-in 260ms ease both;
}

.add-dynamic-panel {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 28px;
  background: rgba(28, 33, 42, 0.78);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(28px) saturate(150%);
}

.add-dynamic-panel strong {
  font-size: 22px;
  font-weight: 880;
}

.add-dynamic-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
  font-weight: 680;
  line-height: 1.42;
}

.add-dynamic-panel textarea {
  min-height: 112px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 12px;
  outline: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font: inherit;
}

.add-dynamic-panel textarea::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.local-media-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.local-media-actions button {
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.95);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  font-size: 13px;
  font-weight: 820;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.local-media-actions button:active {
  transform: scale(0.97);
}

.add-dynamic-panel > button:last-child {
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: #07131d;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 850;
}

.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.14);
  font-size: 22px;
}

.comment-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.18);
}

.comment-sheet[hidden] {
  display: none;
}

.comment-panel {
  width: min(100%, 430px);
  max-height: 68dvh;
  margin: 0 auto;
  padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(30, 35, 43, 0.96);
  box-shadow: 0 -20px 70px rgba(0, 0, 0, 0.34);
  animation: sheet-rise 220ms ease both;
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.comment-panel strong {
  display: block;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 860;
}

.comment-list {
  display: grid;
  gap: 16px;
}

.comment-list p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 680;
}

.comment-list span {
  color: rgba(255, 255, 255, 0.44);
  margin-right: 8px;
}

.comment-input {
  display: block;
  margin-top: 18px;
}

.comment-input input {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  outline: 0;
  font: inherit;
}

.square-modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 18px 10px;
}

.square-module {
  min-width: 0;
}

.square-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.square-module h2 {
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 18px;
  font-weight: 860;
}

.add-square-button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 22px rgba(0, 0, 0, 0.16);
  font-size: 23px;
  line-height: 1;
  backdrop-filter: blur(18px) saturate(160%);
}

.square-card {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  position: relative;
  display: block;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 14px 36px rgba(0, 0, 0, 0.18);
}

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

.square-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 54%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), transparent);
}

.square-card span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 15px;
  font-weight: 820;
}

.square-detail {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  place-items: center;
  padding: max(30px, env(safe-area-inset-top)) 22px max(30px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px) saturate(130%);
}

.square-detail[hidden] {
  display: none;
}

.square-stage {
  width: min(86vw, 370px);
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 28px;
  overflow: hidden;
  background: #05090f;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  touch-action: pan-x;
}

.square-slide {
  width: 100%;
  height: 100%;
  position: relative;
  margin: 0;
  color: #fff;
}

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

.square-slide::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent);
}

.square-slide-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 62px;
  z-index: 1;
  display: grid;
  gap: 5px;
}

.square-slide-copy strong {
  font-size: 21px;
  font-weight: 880;
}

.square-slide-copy span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.34;
}

.respond-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  color: #07131d;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 860;
}

.respond-dialog {
  width: min(88vw, 360px);
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
}

.respond-dialog::backdrop {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.respond-dialog[open] {
  animation: dialog-fade-in 260ms ease both;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px 4px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  font-weight: 700;
}

.app-footer img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.app-footer-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.4;
}
.app-footer-text em {
  font-style: normal;
}

.module-menu-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.module-menu-dialog::backdrop,
.report-dialog::backdrop {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.module-menu-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  background: rgba(28, 33, 42, 0.84);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(24px) saturate(150%);
}

.module-menu-panel {
  grid-template-columns: repeat(3, 84px);
}

.report-dialog {
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
}

.module-menu-panel button {
  height: 40px;
  border: 0;
  border-radius: 999px;
  color: #07131d;
  background: rgba(255, 255, 255, 0.88);
  font-weight: 820;
}

.module-menu-panel .danger,
.person-action-panel .danger {
  color: #fff;
  background: rgba(255, 69, 58, 0.86);
}

.bind-account-dialog {
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
}

.bind-account-dialog::backdrop {
  background: rgba(4, 9, 16, 0.42);
  backdrop-filter: blur(10px);
}

.bind-account-dialog[open] {
  animation: dialog-fade-in 220ms ease both;
}

.bind-account-panel {
  position: relative;
  width: min(340px, calc(100vw - 34px));
  display: grid;
  gap: 13px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 24px 62px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(26px) saturate(150%);
}

.bind-account-panel strong {
  font-size: 19px;
  font-weight: 880;
}

.bind-account-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.bind-account-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.account-form {
  display: grid;
  gap: 10px;
}

.account-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  outline: 0;
  padding: 0 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  font: inherit;
  font-size: 14px;
  font-weight: 720;
}

.account-form input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.bind-account-options button {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  font-size: 14px;
  font-weight: 820;
}

.bind-account-options button:disabled {
  opacity: 0.48;
}

/* ── 账号安全聚合弹窗 ─────────────────────────────────────────────── */
.account-security-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
}
.account-security-dialog::backdrop {
  background: rgba(4, 9, 16, 0.5);
  backdrop-filter: blur(14px);
}
.account-security-dialog[open] {
  animation: dialog-fade-in 220ms ease both;
}

.account-security-panel {
  position: relative;
  width: min(360px, calc(100vw - 28px));
  display: grid;
  gap: 16px;
  padding: 22px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 32px 80px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(32px) saturate(160%);
}

/* 顶部：头像 + 名字 + 二维码 + 关闭 */
.account-security-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-mini-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: transform 120ms ease;
}
.account-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-mini-avatar:active { transform: scale(0.92); }

.account-security-name {
  flex: 1;
  font-size: 15px;
  font-weight: 780;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-qr-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 120ms ease;
}
.account-qr-btn:active { transform: scale(0.92); }

.account-security-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
  font-size: 19px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  line-height: 1;
  transition: transform 120ms ease;
}
.account-security-close:active { transform: scale(0.92); }

.account-security-status {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 650;
}

.account-security-hint {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  line-height: 1.5;
}

/* 三大授权渠道：并排三格 */
.account-auth-channels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.account-channel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 16px 6px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 780;
  transition: background 140ms ease, transform 120ms ease;
}
.account-channel-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

.account-channel-btn.is-linked {
  border-color: rgba(76, 217, 132, 0.62);
  background: rgba(76, 217, 132, 0.18);
  box-shadow: 0 0 0 1px rgba(76, 217, 132, 0.18), 0 10px 26px rgba(76, 217, 132, 0.12);
}

.account-channel-img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
}

.account-channel-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 24px;
}

/* 邮箱输入框（折叠/展开） */
.account-email-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.account-email-form[hidden] { display: none; }

.account-email-form input {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  outline: 0;
}
.account-email-form input::placeholder { color: rgba(255, 255, 255, 0.4); }
.account-email-form input:focus { border-color: rgba(255, 255, 255, 0.45); }

.account-email-submit {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 820;
  white-space: nowrap;
  transition: transform 120ms ease;
}
.account-email-submit:active { transform: scale(0.96); }

/* 底部操作：登录/退出登录 | 通行密钥登录 */
.account-security-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-footer-btn {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  font-weight: 820;
  transition: background 140ms ease, transform 120ms ease;
}
.account-footer-btn:active { transform: scale(0.97); }
.account-footer-btn.is-active {
  color: #06140d;
  border-color: rgba(134, 255, 188, 0.72);
  background: linear-gradient(135deg, rgba(141, 255, 190, 0.96), rgba(73, 216, 140, 0.86));
  box-shadow: 0 10px 28px rgba(79, 220, 144, 0.22);
}

.account-footer-btn.danger {
  color: #ffd9df;
  border-color: rgba(255, 92, 110, 0.28);
  background: rgba(255, 92, 110, 0.1);
}

.dynamic-area,
.square-module {
  transition: width 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.dynamic-area.module-size-large {
  width: 100%;
}

.dynamic-area.module-size-small {
  width: calc(50% - 24px);
  min-width: 0;
  margin-left: 18px;
  padding-left: 0;
  padding-right: 0;
}

.square-module.module-size-small {
  grid-column: auto;
}

.square-module.module-size-large {
  grid-column: 1 / -1;
}

@keyframes dialog-fade-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes sheet-rise {
  from {
    transform: translateY(34px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes recording-pulse {
  0%, 100% {
    filter: blur(2px) brightness(1);
  }
  50% {
    filter: blur(3px) brightness(1.22);
  }
}

@keyframes digital-human-speaking {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: translateY(-2px) scale(1.045);
    filter: brightness(1.16);
  }
}

/* ============================================================
 * UI 修订 v3 (2026-06-27 15:46) — 用户三条需求
 *   1)「设置」卡固定在主页"小心"左侧、保持原状不联动
 *   2) contact-rail 不透明、与下方一体的深色背景
 *   3) 聊天文字/语音输入固定屏幕底部；聊天区填满 rail 与 composer 之间
 * ========================================================== */

/* 1-a 设置卡永远显示在 rail 最左（flex order，无论 JS 怎么重排都生效） */
.contact-rail .contact-card.system-settings,
.contact-rail .contact-card[data-role="digital-human"] {
  order: -100;
}

/* 1-b [UI修订 v8 2026-06-27] 撤回 v3 的"锁死"规则。
 *   原因：v3 给设置卡加了 scroll-snap-align: none + scroll-snap-stop: normal +
 *   transform: none + transition: none，导致横滑过不去、无法进入 active 状态。
 *   现在让它跟其他卡一样响应滑动吸附和选中动画；仅保留 1-a 的 order: -100
 *   维持视觉在最左。
 */

/* 2  rail 整体不透明、与下方页面同调（不透出 body 渐变变化感） */
.contact-rail,
.contact-rail.is-sticky {
  background:
    radial-gradient(ellipse 520px 220px at 18% 0%, rgba(27, 111, 98, 0.50), transparent 70%),
    radial-gradient(ellipse 460px 200px at 84% 0%, rgba(190, 116, 18, 0.42), transparent 60%),
    linear-gradient(180deg, #061522 0%, #0a1428 60%, #0d1626 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 3  composer 已是 .app-frame 的兄弟 + fixed bottom:0；
 *    .app-frame padding-bottom 和 chat-area 强制高度规则已撤回，
 *    不要再改 .app-frame 自身布局（避免破坏原始 composer 锁底）。
 *    chat-area 高度由原始 max-height: calc(100vh-136-132-safe-area) 控制。 */

/* ============================================================
 * UI 修订 v4 (2026-06-27 15:55) — 进一步修正两条
 *   1) rail 背景与 body 完全同款复合渐变 + background-attachment:fixed
 *      rail 等同"开窗"，透出 body 同位置真实背景片段，无缝一体
 *   2) composer-area 强制固定屏幕底部、不随滚动
 * ============================================================ */

/* 1 contact-rail 用 body 完全相同的复合背景，并锁定到视口 */
.contact-rail,
.contact-rail.is-sticky {
  background:
    radial-gradient(circle at 18% 20%, rgba(27, 111, 98, 0.84), transparent 28rem),
    radial-gradient(circle at 84% 24%, rgba(190, 116, 18, 0.92), transparent 22rem),
    radial-gradient(circle at 52% 58%, rgba(34, 59, 168, 0.9), transparent 26rem),
    linear-gradient(145deg, #061522 0%, #0d1428 58%, #2c1905 100%) !important;
  background-attachment: fixed !important;
  background-size: 100vw 100vh, 100vw 100vh, 100vw 100vh, 100vw 100vh !important;
  background-position: 0 0 !important;
  background-repeat: no-repeat !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 2 composer-area 强制锁屏幕底部，挡 JS 注入 transform/top */
.composer-area {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: 0 !important;
  top: auto !important;
  transform: translateX(-50%) !important;
  z-index: 1000 !important;
  width: min(100%, 430px) !important;
}
.composer-area[style*="translateY"],
.composer-area[style*="top:"],
.composer-area[style*="bottom:"] {
  transform: translateX(-50%) !important;
  top: auto !important;
  bottom: 0 !important;
}

/* ============================================================
 * UI 修订 v5 (2026-06-27 16:00) — 两条再修
 *   1) rail 改半透明叠层 + 下边缘渐隐，软化与下方的衔接
 *      （之前 background-attachment:fixed 被 .app-frame 的
 *       will-change:transform 劫持失效，必须改打法）
 *   2) composer 加可见底蒙 + 强制 inset + 拦截 inline style 注入
 * ============================================================ */

/* 1 rail 半透明叠层，让 body 真实背景透出 + 下沿渐隐过渡 */
.contact-rail,
.contact-rail.is-sticky {
  background: linear-gradient(
    180deg,
    rgba(6, 21, 34, 0.42) 0%,
    rgba(6, 21, 34, 0.32) 55%,
    rgba(6, 21, 34, 0.14) 88%,
    rgba(6, 21, 34, 0) 100%
  ) !important;
  background-attachment: scroll !important;
  backdrop-filter: blur(10px) saturate(115%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(115%) !important;
  border: 0 !important;
  box-shadow: none !important;
  /* 让 rail 自身也有遮罩渐隐效果，下沿完全透到下方背景 */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 78%, rgba(0,0,0,0.85) 92%, rgba(0,0,0,0.55) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 78%, rgba(0,0,0,0.85) 92%, rgba(0,0,0,0.55) 100%);
}

/* 2 composer 强制固定 + 可见底蒙 + 防 inline style 注入 */
.composer-area {
  position: fixed !important;
  inset: auto 0 0 0 !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  transform: translate3d(-50%, 0, 0) !important;
  z-index: 9999 !important;
  width: min(100%, 430px) !important;
  contain: layout style;
}
/* composer 底部加一层可见的深色渐变蒙层，让用户看清楚它确实固定在底部 */
.composer-area::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(6, 21, 34, 0) 0%,
    rgba(6, 21, 34, 0.42) 40%,
    rgba(6, 21, 34, 0.72) 70%,
    rgba(6, 21, 34, 0.88) 100%
  );
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}
/* 拦截 app.js 任何对 composer-area 的 inline style 注入 */
.composer-area[style] {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  transform: translate3d(-50%, 0, 0) !important;
  z-index: 9999 !important;
}

/* ============================================================
 * UI 修订 v6 (2026-06-27 16:04) — rail 上下都软衔接
 *   把 mask 改成上下对称渐隐，背景叠层同步两头淡
 * ============================================================ */
.contact-rail,
.contact-rail.is-sticky {
  background: linear-gradient(
    180deg,
    rgba(6, 21, 34, 0) 0%,
    rgba(6, 21, 34, 0.20) 12%,
    rgba(6, 21, 34, 0.34) 48%,
    rgba(6, 21, 34, 0.20) 86%,
    rgba(6, 21, 34, 0) 100%
  ) !important;
  -webkit-mask-image: linear-gradient(
    180deg,
    rgba(0,0,0,0.40) 0%,
    rgba(0,0,0,0.80) 12%,
    #000 26%,
    #000 74%,
    rgba(0,0,0,0.80) 88%,
    rgba(0,0,0,0.40) 100%
  ) !important;
  mask-image: linear-gradient(
    180deg,
    rgba(0,0,0,0.40) 0%,
    rgba(0,0,0,0.80) 12%,
    #000 26%,
    #000 74%,
    rgba(0,0,0,0.80) 88%,
    rgba(0,0,0,0.40) 100%
  ) !important;
}

/* [v10 2026-06-27] readonly profilePublicCard 底部三按钮（关注 / 屏蔽 / 举报） */
.profile-public-card.is-readonly .partner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 14px 4px 4px;
}
.profile-public-card.is-readonly .partner-action-btn {
  height: 38px;
  border: 0;
  border-radius: 999px;
  font-weight: 820;
  font-size: 14px;
  color: #07131d;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, color 0.18s ease;
}
.profile-public-card.is-readonly .partner-action-btn:active {
  transform: scale(0.96);
}
.profile-public-card.is-readonly .partner-action-btn.is-active {
  color: #fff;
  background: rgba(64, 130, 255, 0.86);
}
.profile-public-card.is-readonly .partner-action-btn.danger {
  color: #fff;
  background: rgba(232, 76, 76, 0.86);
}

/* ============================================================
   v15 全局滚动统一规范（2026-06-28）
   背景：旧版 .app-frame { touch-action: none } 禁用所有原生
   触摸滚动，导致每个新加内容区都得单独 pan-y。
   修复：把 app-frame 改为 pan-y 作为"整体遮罩"——内部任何
   区域默认允许纵向触摸滑动（systemInlinePage / profile-public-
   card / profile-section-body / dynamic-area / inline-system-
   card 等一次性全部生效）。
   横向手势组件（.contact-row 左滑、消息泡内手势）通过自身
   touch-action 覆盖，不受影响。
   ============================================================ */
.app-frame {
  touch-action: pan-y;
}


/* ============================================================
   v16 联系人页面优化（2026-06-28）
   1) 搜索框位置上移：把整个 contacts-page 向上平移约 25vh，
      让原本在屏幕中下部的搜索框出现在屏幕 1/4 高度附近。
      用 transform 不影响布局流，也不与 v15 的 touch-action: pan-y
      冲突（transform 不改变 scroll container）。
   2) 联系人列表苹果二级页面磨砂半透明：移除 contact-row 几乎透明的
      hit-test 底色，改为统一磨砂卡片背景，与搜索结果列表样式一致。
   ============================================================ */
body.phone-directory-page .contacts-page {
  transform: translateY(-25vh);
}
body.phone-directory-page .contacts-list {
  padding-bottom: calc(25vh + 24px);
  gap: 10px;
}
body.phone-directory-page .contact-row {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-radius: 14px;
  padding: 12px 14px;
}
body.phone-directory-page .contact-row:active {
  background: rgba(255, 255, 255, 0.18);
}
body.phone-directory-page .contact-row-wrap {
  border-radius: 14px;
}


.profile-private-hint {
  margin: -2px 0 4px;
  color: rgba(63, 74, 86, 0.68);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}


.system-avatar-dialog {
  width: min(92vw, 380px);
  border: 0;
  padding: 0;
  border-radius: 22px;
  background: transparent;
}
.system-avatar-dialog::backdrop {
  background: rgba(4, 9, 16, 0.48);
  backdrop-filter: blur(12px);
}
.system-avatar-dialog[open] {
  animation: dialog-fade-in 220ms ease both;
}
.system-avatar-panel {
  position: relative;
  display: grid;
  gap: 16px;
  max-height: min(74vh, 620px);
  padding: 22px 18px 18px;
  overflow: hidden;
  color: #fff;
  background: rgba(9, 18, 28, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}
.system-avatar-panel strong {
  font-size: 18px;
  font-weight: 880;
}
.system-avatar-content {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  padding-right: 2px;
}
.system-avatar-section {
  display: grid;
  gap: 10px;
}
.system-avatar-section h3 {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 820;
}
.system-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.system-avatar-option {
  aspect-ratio: 1;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
.system-avatar-option img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.system-avatar-option.is-selected {
  border-color: rgba(98, 216, 160, 0.96);
  background: rgba(98, 216, 160, 0.18);
}
.system-avatar-option:active {
  transform: scale(0.94);
}

/* ════════════════════════════════════════════════════════════════
   [v18 combo1] 智能体卡片：方形头像 + 右下角 AI 角标
   markAiEntryCards() 在 JS 中给智能体 .contact-card 加 .ai-entry class
   ════════════════════════════════════════════════════════════════ */
.contact-card.ai-entry { position: relative; }
.contact-card.ai-entry .contact-row-avatar,
.contact-card.ai-entry img.contact-row-avatar,
.contact-card.ai-entry > img,
.contact-card.ai-entry .group-avatar-grid {
  border-radius: 12px !important;
}
.contact-card.ai-entry::after {
  content: "AI";
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, #18a058, #0d2a24);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  line-height: 1.15;
  letter-spacing: 0.4px;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* ════════════════════════════════════════════════════════════════
   [v18 combo1] 创建话题 / 添加成员 picker：半透明磨砂风格
   与通讯录联系人列表视觉统一
   ════════════════════════════════════════════════════════════════ */
.create-topic-page,
dialog.create-topic-page {
  background: rgba(16, 32, 48, 0.68) !important;
  backdrop-filter: blur(28px) saturate(170%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(170%) !important;
  border: 1px solid rgba(255, 255, 255, 0.20) !important;
  border-radius: 22px !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 24px 60px rgba(0, 0, 0, 0.38);
}
.create-topic-page::backdrop,
dialog.create-topic-page::backdrop {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* 输入区：去掉容器边框/背景，只保留内容间距，避免"盒中盒"双框感 */
.create-topic-page .create-topic-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  margin: 0 0 4px;
  padding: 12px 18px;
}
.create-topic-page input[type="text"],
.create-topic-page input:not([type]) {
  background: transparent;
  border: none;
  color: #fff;
}
.create-topic-page .contact-row-avatar {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
/* 行 active 与通讯录行一致 */
.create-topic-page .topic-contact-row:active {
  background: rgba(255, 255, 255, 0.10);
}
/* 标签页按钮和通讯录标签视觉统一 */
.create-topic-page .contacts-tab {
  border-color: rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.70);
}
.create-topic-page .contacts-tab.is-active {
  background: rgba(255, 255, 255, 0.90);
  color: #07131d;
  border-color: transparent;
}
/* iOS Safari：用 svh（小视口高度）解决地址栏遮挡列表问题 */
@supports (-webkit-touch-callout: none) {
  .create-topic-page {
    max-height: min(640px, calc(100svh - 64px));
  }
}

/* ════════════════════════════════════════════════════════════════
   [v18 combo1] 头像本地上传入口样式
   ════════════════════════════════════════════════════════════════ */
.system-avatar-option.upload-avatar-option {
  aspect-ratio: 1 / 1;
  min-height: 64px;
  transition: background 160ms ease, border-color 160ms ease;
}
.system-avatar-option.upload-avatar-option:hover,
.system-avatar-option.upload-avatar-option:focus-visible {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.55) !important;
  outline: none;
}

.chat-message.outgoing .chat-bubble-wrap {
  flex: 0 1 auto;
  max-width: 82%;
}

.chat-text-block,
.voice-text-block {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.94);
  background: transparent;
  backdrop-filter: blur(20px) saturate(140%);
}

.chat-message.incoming .chat-text-block,
.chat-message.incoming .voice-text-block {
  border-color: rgba(255, 255, 255, 0.5);
  background: transparent;
  backdrop-filter: none;
}

.chat-message.outgoing .chat-text-block,
.chat-message.outgoing .voice-text-block {
  background: rgba(255, 255, 255, 0.34);
}

.chat-text-block .chat-bubble-text,
.voice-text-block .voice-bubble-text {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.94);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-text-block .chat-bubble-text {
  font-size: 15px;
  font-weight: 680;
  line-height: 1.36;
}

.chat-text-block.is-collapsible:not(.is-expanded) .chat-bubble-text,
.voice-text-block.is-collapsible:not(.is-expanded) .voice-bubble-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-text-block.is-expanded .chat-bubble-text,
.voice-text-block.is-expanded .voice-bubble-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* chatfold4: 单层宽气泡。外层是真气泡，内层 p 只承载文字和内联折叠符号。 */
.chat-bubble-wrap.chat-text-block,
.voice-message-wrap .voice-text-block {
  position: relative;
  display: block;
  width: auto;
  max-width: calc(100% - 18px);
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.94);
  background: transparent;
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: none;
}

.chat-message.incoming .chat-bubble-wrap.chat-text-block,
.chat-message.incoming .voice-message-wrap .voice-text-block {
  max-width: calc(100% - 43px);
  border-color: rgba(255, 255, 255, 0.5);
  background: transparent;
  backdrop-filter: none;
}

.chat-message.outgoing .chat-bubble-wrap.chat-text-block,
.chat-message.outgoing .voice-message-wrap .voice-text-block {
  max-width: 94%;
  background: rgba(255, 255, 255, 0.34);
}

.chat-text-block .chat-bubble-text,
.voice-text-block .voice-bubble-text,
.chat-text-block.is-collapsible .chat-bubble-text,
.voice-text-block.is-collapsible .voice-bubble-text,
.chat-text-block.is-collapsible:not(.is-expanded) .chat-bubble-text,
.voice-text-block.is-collapsible:not(.is-expanded) .voice-bubble-text,
.chat-text-block.is-expanded .chat-bubble-text,
.voice-text-block.is-expanded .voice-bubble-text {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.94);
  background: transparent;
  backdrop-filter: none;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.chat-text-block .chat-bubble-text {
  font-size: 15px;
  font-weight: 680;
  line-height: 1.36;
}

.voice-text-block .voice-bubble-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.bubble-collapse-toggle {
  position: static;
  width: auto;
  height: auto;
  min-width: 0;
  margin: 0 0 0 2px;
  padding: 0 1px;
  border: 0;
  border-radius: 0;
  color: #009dff;
  background: transparent;
  display: inline-grid;
  vertical-align: -1px;
  place-items: center;
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
  box-shadow: none;
  backdrop-filter: none;
}

.bubble-collapse-toggle span {
  display: inline-block;
  transform: rotate(90deg);
  transform-origin: center;
}

.bubble-collapse-toggle.is-expanded span {
  transform: rotate(-90deg);
}


/* summaryflow1: two-step chat summary message and save-to-moments card */
.summary-text-message .chat-bubble-wrap {
  max-width: min(86%, 360px);
}

.summary-save-card-message {
  justify-content: flex-start;
}

.summary-save-card {
  width: min(86%, 340px);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #12202c;
  box-shadow: 0 8px 22px rgba(10, 24, 38, 0.16);
  backdrop-filter: blur(14px);
}

.summary-save-card-title {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 780;
}

.summary-save-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.summary-save-actions button {
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 760;
  color: #fff;
  background: #1976d2;
}

.summary-save-actions button[data-summary-save-action="no"] {
  color: #22313f;
  background: rgba(34, 49, 63, 0.1);
}

.summary-save-status {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(18, 32, 44, 0.62);
}

.add-dynamic-panel textarea.is-summary-locked {
  min-height: 220px;
  max-height: none;
  overflow: hidden;
  resize: none;
  background: rgba(255, 255, 255, 0.82);
  color: #172536;
}

/* ── 邮箱验证码 passwordless 登录 UI（2026-07-01） ───────────── */
.account-email-form { display: flex; flex-direction: column; gap: 8px; }
.account-email-form input { padding: 10px 12px; border-radius: 10px; border: 1px solid #d0d7de; font-size: 15px; }
#accountEmailCodeInput { letter-spacing: 6px; font-size: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.account-email-hint { margin: 2px 0 0; font-size: 13px; line-height: 1.4; }
.account-email-hint[data-kind="error"] { color: #dc2626; }
.account-email-hint[data-kind="success"] { color: #16a34a; }
.account-email-hint[data-kind="info"] { color: #6b7280; }
.account-email-submit:disabled { opacity: .5; cursor: not-allowed; }
