.h5-expired-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--h5-bg, #0a0a0a);
    color: var(--h5-text, #fff);
    padding: 24px;
    font-family: var(--h5-font-body, -apple-system, system-ui, sans-serif);
  }
  .h5-expired-content {
    text-align: center;
  }
  .h5-expired-title {
    font-family: var(--h5-font-heading, var(--h5-font-body, -apple-system, system-ui, sans-serif));
    font-size: var(--h5-text-lg, 16px);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--h5-text, #fff);
  }
  .h5-expired-hint {
    font-size: var(--h5-text-base, 14px);
    color: var(--h5-text-secondary, #999);
  }


.h5-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--h5-bg, #0a0a0a);
  color: var(--h5-text, #fff);
  font-family: var(--h5-font-body, -apple-system, system-ui, sans-serif);
  font-size: var(--h5-text-md, 15px);
  -webkit-tap-highlight-color: transparent;
}
.h5-header {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 留出顶部安全区（刘海屏/WebView 状态栏），内容下移避免被遮挡 */
  height: calc(48px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  border-bottom: 1px solid var(--h5-border-subtle, #1a1a1a);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.h5-header-title {
  flex: 1;
  font-family: var(--h5-font-heading, var(--h5-font-body, -apple-system, system-ui, sans-serif));
  font-size: var(--h5-text-lg, 16px);
  font-weight: 600;
}
.h5-icon-btn {
  background: transparent;
  border: none;
  color: var(--h5-text, #fff);
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--h5-radius-md, 8px);
}
.h5-icon-btn:hover {
  background: var(--h5-surface-hover, #1f1f1f);
}
.h5-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms ease, visibility 400ms ease;
}
.h5-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}
.h5-drawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background: var(--h5-surface, #131313);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.h5-drawer.open {
  transform: translateX(0);
}
.h5-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 16px 16px;
  border-bottom: 1px solid var(--h5-border-subtle, #1a1a1a);
}
.h5-drawer-title {
  font-size: var(--h5-text-md, 15px);
  font-weight: 600;
}
.h5-drawer-new-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--h5-border, #2a2a2a);
  background: transparent;
  color: var(--h5-text, #fff);
  cursor: pointer;
  padding: 0;
}
.h5-drawer-new-btn:active {
  background: var(--h5-surface-hover, #1f1f1f);
}
.h5-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.h5-empty {
  padding: 24px;
  text-align: center;
  color: var(--h5-text-secondary, #999);
  font-family: var(--h5-font-heading, var(--h5-font-body, -apple-system, system-ui, sans-serif));
  font-size: var(--h5-text-base, 14px);
}
.h5-session-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--h5-text, #fff);
  padding: 12px 14px;
  border-radius: var(--h5-radius-content, 10px);
  cursor: pointer;
  margin-bottom: 4px;
}
.h5-session-item:hover {
  background: var(--h5-surface-hover, #1f1f1f);
}
.h5-session-item.active {
  background: var(--h5-accent, #6366f1);
  color: var(--h5-on-accent, #fff);
}
.h5-session-item.active:hover {
  background: var(--h5-accent-hover, #5558e3);
}
.h5-session-title {
  flex: 1;
  font-size: var(--h5-text-base, 14px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h5-session-time {
  font-size: var(--h5-text-xs, 11px);
  color: var(--h5-text-secondary, #999);
  flex-shrink: 0;
}
.h5-session-item.active .h5-session-time {
  color: var(--h5-on-accent, #fff);
  opacity: 0.8;
}
.h5-session-more {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms ease;
  padding: 0;
}
.h5-session-item:hover .h5-session-more,
.h5-session-item.active .h5-session-more {
  opacity: 1;
}
@media (hover: none), (pointer: coarse) {
  .h5-session-more {
    opacity: 0.72;
  }
}
.h5-session-more:active {
  background: rgba(255, 255, 255, 0.1);
}
.h5-session-menu {
  position: absolute;
  right: 10px;
  top: calc(100% - 4px);
  z-index: 20;
  background: var(--h5-surface, #1a1a1a);
  border: 1px solid var(--h5-border, #2a2a2a);
  border-radius: var(--h5-radius-md, 8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  min-width: 120px;
}
.h5-session-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--h5-text, #fff);
  font-size: var(--h5-text-base, 14px);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.h5-session-menu-item.danger {
  color: var(--h5-error, #ef4444);
}
.h5-session-menu-item:hover {
  background: var(--h5-surface-hover, #1f1f1f);
}
/* 居中确认弹框（删除等二次确认） */
.h5-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: h5-fade-in 150ms ease;
}
.h5-modal {
  width: 100%;
  max-width: 320px;
  background: var(--h5-surface, #1a1a1a);
  border-radius: var(--h5-radius-xl, 16px);
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.h5-modal-title {
  margin-bottom: 8px;
  font-size: var(--h5-text-lg, 16px);
  font-weight: 600;
  color: var(--h5-text, #fff);
}
.h5-modal-desc {
  margin-bottom: 16px;
  font-size: var(--h5-text-base, 14px);
  line-height: 1.5;
  color: var(--h5-text-secondary, #999);
}
.h5-modal-error {
  margin-bottom: 12px;
  font-size: var(--h5-text-sm, 12px);
  color: var(--h5-error, #ef4444);
}
.h5-modal-actions {
  display: flex;
  gap: 8px;
}
.h5-modal-btn {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--h5-radius-md, 8px);
  border: 1px solid var(--h5-border, #2a2a2a);
  background: transparent;
  color: var(--h5-text, #fff);
  font-size: var(--h5-text-base, 14px);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.h5-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.h5-modal-btn.danger {
  background: var(--h5-error, #ef4444);
  border-color: var(--h5-error, #ef4444);
  color: var(--h5-on-accent, #fff);
}
.h5-modal-btn.danger:active:not(:disabled) {
  opacity: 0.85;
}
.h5-modal-btn.primary {
  background: var(--h5-accent, #6366f1);
  border-color: var(--h5-accent, #6366f1);
  color: var(--h5-on-accent, #fff);
}
.h5-modal-btn.primary:active:not(:disabled) {
  opacity: 0.85;
}
/* 重命名 modal 的输入框 */
.h5-modal-input {
  width: 100%;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--h5-radius-md, 8px);
  border: 1px solid var(--h5-border, #2a2a2a);
  background: var(--h5-bg, #0a0a0a);
  color: var(--h5-text, #fff);
  font-size: var(--h5-text-base, 14px);
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
}
.h5-modal-input:focus {
  border-color: var(--h5-accent, #6366f1);
}
/* 全局 toast（反色胶囊，底部居中，悬浮于输入框上方） */
.h5-toast {
  position: fixed;
  left: 50%;
  bottom: calc(104px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  padding: 9px 18px;
  background: var(--h5-text, #ffffff);
  color: var(--h5-bg, #0a0a0a);
  border-radius: var(--h5-radius-full, 9999px);
  font-size: var(--h5-text-sm, 12px);
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  animation: h5-toast-in 200ms ease;
}
.h5-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.h5-messages {
  flex: 1;
  overflow-y: auto;
  /* 防止 iOS 橡皮筋滚动露出外层背景 */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 12px;
}
.h5-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--h5-text-secondary, #999);
  font-family: var(--h5-font-heading, var(--h5-font-body, -apple-system, system-ui, sans-serif));
  font-size: var(--h5-text-md, 15px);
}
.h5-welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 40px 20px;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.h5-welcome-icon {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  border-radius: var(--h5-radius-xl, 18px);
  background: var(--h5-surface, #1a1a1a);
  border: 1px solid var(--h5-border-subtle, #1a1a1a);
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.h5-welcome-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.h5-welcome-icon-monogram {
  font-size: 28px;
  font-weight: 700;
  color: var(--h5-text-secondary, #999);
  font-family: var(--h5-font-heading, var(--h5-font-body, -apple-system, system-ui, sans-serif));
}
.h5-welcome-title {
  font-family: var(--h5-font-heading, var(--h5-font-body, -apple-system, system-ui, sans-serif));
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--h5-text, #fff);
  letter-spacing: -0.02em;
}
.h5-welcome-desc {
  font-size: 15px;
  color: var(--h5-text-secondary, #999);
  line-height: 1.65;
  margin-bottom: 32px;
}
.h5-welcome-label {
  width: 100%;
  max-width: 420px;
  font-size: var(--h5-text-xs, 11px);
  font-weight: 600;
  color: var(--h5-text-secondary, #999);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  margin-bottom: 10px;
  padding-left: 4px;
}
.h5-welcome-body {
  width: 100%;
  max-width: 420px;
  text-align: left;
  background: var(--h5-surface, #1a1a1a);
  border: 1px solid var(--h5-border-subtle, #1a1a1a);
  border-radius: var(--h5-radius-xl, 18px);
  padding: 22px 24px;
  font-size: var(--h5-text-md, 15px);
  color: var(--h5-text, #fff);
  line-height: 1.7;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.h5-welcome-body .h5-md-p {
  margin-bottom: 14px;
  /* 引导语配置中的单次回车也按可见换行渲染。 */
  white-space: pre-line;
}
.h5-welcome-body .h5-md-p:last-child {
  margin-bottom: 0;
}
.h5-welcome-body .h5-md-ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.h5-welcome-body .h5-md-li {
  position: relative;
  padding-left: 18px;
  color: var(--h5-text-secondary, #999);
  font-size: var(--h5-text-base, 14px);
}
.h5-welcome-body .h5-md-li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--h5-accent, #6366f1);
}
.h5-welcome-body .h5-md-strong {
  color: var(--h5-text, #fff);
  font-weight: 600;
}
.h5-skeleton-list {
  padding: 4px 0;
}
.h5-skeleton-bubble {
  height: 44px;
  margin-bottom: 12px;
  width: 70%;
}
.h5-skeleton-bubble.assistant {
  margin-right: auto;
}
.h5-skeleton-bubble.user {
  margin-left: auto;
  width: 50%;
}
.h5-skeleton-bubble.short {
  width: 45%;
  height: 36px;
}
.h5-msg {
  margin-bottom: 12px;
  max-width: 85%;
}
.h5-msg.user {
  margin-left: auto;
}
.h5-msg.assistant {
  margin-right: auto;
}
.h5-msg-content {
  padding: 10px 14px;
  border-radius: var(--h5-radius-bubble, 16px);
  font-size: var(--h5-text-md, 15px);
  line-height: 1.5;
  word-break: break-word;
}
.h5-msg.user .h5-msg-content {
  background: var(--h5-user-message-bg, var(--h5-accent, #6366f1));
  color: var(--h5-user-message-text, var(--h5-on-accent, #fff));
}
.h5-msg.assistant .h5-msg-content {
  background: var(--h5-surface, #1a1a1a);
  color: var(--h5-conversation-text, var(--h5-text, #fff));
}
.h5-tool-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: var(--h5-radius-md, 8px);
  background: var(--h5-surface-hover, #1f1f1f);
  font-size: var(--h5-text-sm, 12px);
  color: var(--h5-text-secondary, #999);
}
.h5-tool-bubble.error {
  color: var(--h5-error, #ef4444);
}
/* 「正在思考...」三点跳动 typing indicator。
   currentColor 跟随 .h5-tool-bubble 的 color，深色/暖色两套主题自动适配。 */
.h5-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.h5-typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: h5-typing 1.2s ease-in-out infinite;
}
.h5-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.h5-typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes h5-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.h5-input-bar {
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--h5-border-subtle, #1a1a1a);
  background: var(--h5-bg, #0a0a0a);
  flex-shrink: 0;
}
/* composer 正下方的免责小字：居中、muted、与 composer 同宽对齐。 */
.h5-disclaimer {
  margin: 6px auto 0;
  max-width: min(100%, 720px);
  text-align: center;
  color: var(--h5-text-muted, #999);
  font-size: var(--h5-text-xs, 11px);
  font-family: var(--h5-font-body);
  line-height: 1.4;
}
.h5-composer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
.h5-input {
  flex: 1;
  background: var(--h5-surface, #1a1a1a);
  border: 1px solid var(--h5-border, #2a2a2a);
  border-radius: var(--h5-radius-input, 16px);
  padding: 10px 14px;
  font-size: 16px;
  color: var(--h5-text, #fff);
  outline: none;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
  font-family: inherit;
}
.h5-input:focus {
  border-color: var(--h5-accent, #6366f1);
}
.h5-send-btn {
  background: var(--h5-accent, #6366f1);
  color: var(--h5-on-accent, #fff);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms ease, transform 100ms ease;
}
.h5-send-btn:hover:not(:disabled) {
  background: var(--h5-accent-hover, #5558e3);
}
.h5-send-btn:active:not(:disabled) {
  transform: scale(0.96);
}
.h5-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* 以下附件卡片 class 由模块级 renderUserContent / renderAssistantContent
   动态渲染（不在组件 JSX 树内，styled-jsx 不会打 scoped 标记），
   必须用  才能命中——与 h5-markdown-renderer 的 .h5-md-*
   同理。class 带 h5- 前缀，仅命中 H5 自身 DOM，不耦合 web 端。 */
.h5-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.h5-attachment-image {
  width: 80px;
  height: 80px;
  border-radius: var(--h5-radius-content, 10px);
  object-fit: cover;
  cursor: pointer;
}
.h5-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--h5-radius-content, 10px);
  background: var(--h5-surface, #1a1a1a);
  border: 1px solid var(--h5-border-subtle, #1a1a1a);
  text-decoration: none;
  max-width: 100%;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.h5-attachment-file:active {
  background: var(--h5-surface-hover, #1f1f1f);
  transform: scale(0.97);
}
.h5-attachment-icon {
  flex-shrink: 0;
  color: var(--h5-accent, #6366f1);
}
.h5-attachment-name {
  font-size: var(--h5-text-sm, 12px);
  font-weight: 500;
  color: var(--h5-text, #fff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.h5-attachment-size {
  font-size: var(--h5-text-xs, 11px);
  color: var(--h5-text-secondary, #999);
  flex-shrink: 0;
}
.h5-attachment-file.pending {
  opacity: 0.65;
  pointer-events: none;
}
.h5-attachment-file.pending .h5-attachment-icon {
  color: var(--h5-text-secondary, #999);
  animation: h5-spin 1s linear infinite;
}
/* assistant 消息左下角的复制按钮（h5-message-render 的 H5CopyButton 渲染）。 */
.h5-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 5px;
  border: none;
  background: transparent;
  border-radius: var(--h5-radius-sm, 6px);
  color: var(--h5-text-muted, #aaa298);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 150ms ease, background 150ms ease;
}
.h5-copy-btn:hover {
  color: var(--h5-text-secondary);
  background: var(--h5-surface-hover);
}
.h5-copy-btn.copied {
  color: var(--h5-success);
}
.h5-attach-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 12px 0;
}
.h5-attach-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--h5-radius-md, 8px);
  background: var(--h5-surface, #1a1a1a);
  border: 1px solid var(--h5-border, #2a2a2a);
  max-width: 220px;
}
.h5-attach-thumb {
  width: 32px;
  height: 32px;
  border-radius: var(--h5-radius-sm, 6px);
  object-fit: cover;
  flex-shrink: 0;
}
.h5-attach-icon-wrap {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--h5-text-secondary, #999);
  flex-shrink: 0;
}
.h5-attach-remove {
  background: transparent;
  border: none;
  color: var(--h5-text-secondary, #999);
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.h5-attach-remove:hover {
  color: var(--h5-error, #ef4444);
}
.h5-attach-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}
.h5-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

/* Talking with Pi 提炼出的阅读型结构。仅 editorial 预设启用，旧主题保持不变。 */
.h5-app[data-h5-visual-style='editorial'] .h5-header {
  height: calc(64px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  border-bottom: none;
  background: var(--h5-bg, #f9f4ec);
}
.h5-app[data-h5-visual-style='editorial'] .h5-header > .h5-icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--h5-control-bg, var(--h5-surface-hover));
  color: var(--h5-text, #1b3c28);
}
.h5-app[data-h5-visual-style='editorial'] .h5-header-title {
  font-family: var(--h5-font-heading, var(--h5-font-body));
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.h5-app[data-h5-visual-style='editorial'] .h5-drawer {
  background: var(--h5-surface, #fcfaf6);
}
.h5-app[data-h5-visual-style='editorial'] .h5-session-item.active,
.h5-app[data-h5-visual-style='editorial'] .h5-session-item.active:hover {
  background: var(--h5-surface-active, #ebe2d3);
  color: var(--h5-text, #1b3c28);
}
.h5-app[data-h5-visual-style='editorial'] .h5-session-item.active .h5-session-time {
  color: var(--h5-text-secondary, #405846);
}
.h5-app[data-h5-visual-style='editorial'] .h5-messages {
  padding: 20px 24px 32px;
  scrollbar-color: var(--h5-text-muted, #aaa298) transparent;
}
.h5-app[data-h5-visual-style='editorial'] .h5-welcome-card {
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 100%;
  max-width: var(--h5-read-width, 680px);
  padding: 36px 0 56px;
  text-align: left;
}
.h5-app[data-h5-visual-style='editorial'] .h5-welcome-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border: none;
  border-radius: var(--h5-radius-composer, 28px);
  background: var(--h5-control-bg, #ebe2d3);
  box-shadow: none;
  font-size: 26px;
}
.h5-app[data-h5-visual-style='editorial'] .h5-welcome-icon-monogram {
  color: var(--h5-text, #1b3c28);
  font-family: var(--h5-font-heading, serif);
  font-size: 25px;
}
.h5-app[data-h5-visual-style='editorial'] .h5-welcome-title {
  margin-bottom: 12px;
  color: var(--h5-conversation-text, var(--h5-text));
  font-family: var(--h5-font-heading, serif);
  font-size: clamp(30px, 9vw, 38px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.h5-app[data-h5-visual-style='editorial'] .h5-welcome-desc {
  max-width: 48ch;
  margin-bottom: 28px;
  color: var(--h5-text-secondary, #405846);
  font-family: var(--h5-font-conversation, var(--h5-font-body));
  font-size: var(--h5-fs-conversation, 17px);
  line-height: 1.6;
  text-wrap: pretty;
}
.h5-app[data-h5-visual-style='editorial'] .h5-welcome-label {
  display: none;
}
.h5-app[data-h5-visual-style='editorial'] .h5-welcome-body {
  max-width: 58ch;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--h5-conversation-text, var(--h5-text));
  font-family: var(--h5-font-conversation, var(--h5-font-body));
  font-size: var(--h5-fs-conversation, 17px);
  line-height: var(--h5-lh-conversation, 1.7);
}
.h5-app[data-h5-visual-style='editorial'] .h5-msg {
  width: min(100%, var(--h5-read-width, 680px));
  max-width: var(--h5-read-width, 680px);
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 24px;
}
.h5-app[data-h5-visual-style='editorial'] .h5-msg.assistant .h5-msg-content {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--h5-conversation-text, var(--h5-text));
  font-family: var(--h5-font-conversation, var(--h5-font-body));
  font-size: var(--h5-fs-conversation, 17px);
  line-height: var(--h5-lh-conversation, 1.7);
}
.h5-app[data-h5-visual-style='editorial'] .h5-msg.user .h5-msg-content {
  width: fit-content;
  max-width: 82%;
  margin-left: auto;
  padding: 9px 13px;
  border-radius: var(--h5-radius-content, 10px);
  background: var(--h5-user-message-bg, #f3eadd);
  color: var(--h5-user-message-text, #1b3c28);
  font-family: var(--h5-font-conversation, var(--h5-font-body));
  font-size: 16px;
  line-height: 1.45;
}
.h5-app[data-h5-visual-style='editorial'] .h5-msg.assistant .h5-md-h1 {
  font-size: 26px;
  line-height: 1.16;
}
.h5-app[data-h5-visual-style='editorial'] .h5-msg.assistant .h5-md-h2 {
  font-size: 22px;
  line-height: 1.22;
}
.h5-app[data-h5-visual-style='editorial'] .h5-msg.assistant .h5-md-h3 {
  font-size: 18px;
  line-height: 1.3;
}
.h5-app[data-h5-visual-style='editorial'] .h5-msg.assistant .h5-md-p {
  margin-bottom: 14px;
}
.h5-app[data-h5-visual-style='editorial'] .h5-tool-bubble {
  padding: 0;
  background: transparent;
  color: var(--h5-text-secondary, #405846);
  font-family: var(--h5-font-body);
  font-size: 13px;
}
.h5-app[data-h5-visual-style='editorial'] .h5-skeleton-list {
  width: min(100%, var(--h5-read-width, 680px));
  margin: 0 auto;
}
.h5-app[data-h5-visual-style='editorial'] .h5-skeleton-bubble.assistant {
  height: 18px;
  margin-bottom: 10px;
  border-radius: 3px;
  width: 92%;
}
.h5-app[data-h5-visual-style='editorial'] .h5-skeleton-bubble.assistant.short {
  width: 58%;
}
.h5-app[data-h5-visual-style='editorial'] .h5-skeleton-bubble.user {
  height: 38px;
  width: 54%;
  margin-top: 24px;
  border-radius: var(--h5-radius-content, 10px);
}
.h5-app[data-h5-visual-style='editorial'] .h5-attach-tray {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 8px 18px 0;
}
.h5-app[data-h5-visual-style='editorial'] .h5-attach-chip {
  background: var(--h5-surface-hover, #f3eadd);
  border-color: var(--h5-border-subtle, #e9e1d5);
}
.h5-app[data-h5-visual-style='editorial'] .h5-input-bar {
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  border-top: none;
  background: var(--h5-bg, #f9f4ec);
}
.h5-app[data-h5-visual-style='editorial'] .h5-composer {
  width: min(100%, 720px);
  min-height: 56px;
  margin: 0 auto;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--h5-border, #ded6c8);
  border-radius: var(--h5-radius-composer, 28px);
  background: var(--h5-composer-bg, #fcfaf6);
  transition: border-color 150ms ease;
}
.h5-app[data-h5-visual-style='editorial'] .h5-composer:focus-within {
  border-color: var(--h5-accent, #37804c);
}
.h5-app[data-h5-visual-style='editorial'] .h5-input {
  min-height: 44px;
  padding: 10px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--h5-conversation-text, var(--h5-text));
  font-family: var(--h5-font-conversation, var(--h5-font-body));
  font-size: var(--h5-fs-conversation, 17px);
  line-height: 1.35;
}
.h5-app[data-h5-visual-style='editorial'] .h5-input::placeholder {
  color: var(--h5-text-muted, #aaa298);
  opacity: 1;
}
.h5-app[data-h5-visual-style='editorial'] .h5-input:focus {
  border-color: transparent;
}
.h5-app[data-h5-visual-style='editorial'] .h5-attach-btn,
.h5-app[data-h5-visual-style='editorial'] .h5-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.h5-app[data-h5-visual-style='editorial'] .h5-attach-btn {
  color: var(--h5-text-secondary, #405846);
}
.h5-app[data-h5-visual-style='editorial'] .h5-attach-btn:hover:not(:disabled) {
  background: var(--h5-control-bg, #ebe2d3);
}
.h5-app[data-h5-visual-style='editorial'] .h5-send-btn {
  background: var(--h5-accent, #37804c);
}
.h5-app[data-h5-visual-style='editorial'] .h5-send-btn:disabled {
  background: var(--h5-control-bg, #ebe2d3);
  color: var(--h5-text-muted, #aaa298);
  opacity: 1;
}

/* 人物介绍型欢迎卡：仅用于空会话欢迎区域，不改变 editorial 消息流骨架。 */
.h5-beta-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--h5-radius-full, 9999px);
  background: var(--h5-accent, #2f53ef);
  color: var(--h5-on-accent, #fff);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--h5-font-body);
  line-height: 1.4;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.h5-app[data-h5-visual-style='editorial'] .h5-welcome-card-profile {
  width: 100%;
  /* 与底部 composer 共用同一条 720px 内容轴线。 */
  max-width: 720px;
  padding-top: 24px;
}
.h5-welcome-profile-card {
  width: 100%;
  padding: 18px 0 10px;
  /* 欢迎内容直接融入页面，不再套用独立的大卡片容器。 */
  background: transparent;
}
.h5-welcome-profile-content {
  display: grid;
  grid-template-columns: minmax(190px, 0.82fr) minmax(0, 1.65fr);
  grid-template-areas:
    'media identity'
    'media body';
  column-gap: 34px;
  align-items: center;
}
.h5-welcome-profile-media {
  grid-area: media;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
}
.h5-app[data-h5-visual-style='editorial'] .h5-welcome-profile-media .h5-welcome-icon {
  width: 160px;
  height: 160px;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: none;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  font-size: 46px;
}
.h5-welcome-profile-media .h5-welcome-icon img {
  object-position: center top;
}
.h5-welcome-profile-identity {
  grid-area: identity;
  align-self: end;
  padding-top: 4px;
}
.h5-welcome-profile-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 8px;
  color: var(--h5-text, #231f2a);
  font-family: var(--h5-font-heading, var(--h5-font-body));
  font-size: 27px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.h5-welcome-profile-title > span {
  color: var(--h5-accent, #2f53ef);
}
.h5-welcome-profile-sparkle {
  color: var(--h5-accent, #2f53ef);
  opacity: 0.65;
}
.h5-welcome-profile-desc {
  margin: 0;
  color: var(--h5-text-secondary, #575a68);
  font-family: var(--h5-font-body);
  font-size: 14px;
  line-height: 1.6;
}
.h5-welcome-profile-body {
  grid-area: body;
  align-self: start;
  margin-top: 20px;
  color: var(--h5-conversation-text, var(--h5-text));
  font-family: var(--h5-font-conversation, var(--h5-font-body));
  font-size: 16px;
  line-height: 1.65;
}
.h5-welcome-profile-body .h5-md-p {
  margin-bottom: 10px;
  /* 与标准欢迎区一致，保留引导语 Markdown 段落内的单次回车。 */
  white-space: pre-line;
}
.h5-welcome-profile-body .h5-md-p:last-child {
  margin-bottom: 0;
}
.h5-welcome-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--h5-border-subtle, #eceef6);
}
.h5-welcome-highlight {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  text-align: left;
}
.h5-welcome-highlight-icon {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1px;
  color: var(--h5-accent, #2f53ef);
}
.h5-welcome-highlight-heart .h5-welcome-highlight-icon {
  color: var(--h5-error, #ef5b67);
}
.h5-welcome-highlight h2 {
  margin: 0 0 4px;
  color: var(--h5-text, #231f2a);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}
.h5-welcome-highlight p {
  margin: 0;
  color: var(--h5-text-secondary, #575a68);
  font-size: 12px;
  line-height: 1.55;
}
@media (max-width: 640px) {
  .h5-app[data-h5-visual-style='editorial'] .h5-welcome-card-profile {
    padding-top: 12px;
    padding-bottom: 32px;
  }
  .h5-welcome-profile-card {
    padding: 8px 0 4px;
  }
  .h5-welcome-profile-content {
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-areas:
      'media identity'
      'body body';
    column-gap: 16px;
    align-items: center;
  }
  .h5-welcome-profile-media {
    min-height: 88px;
  }
  .h5-app[data-h5-visual-style='editorial'] .h5-welcome-profile-media .h5-welcome-icon {
    width: 88px;
    height: 88px;
    min-height: 0;
    border-radius: 50%;
    font-size: 34px;
  }
  .h5-welcome-profile-identity {
    align-self: center;
    padding: 0;
  }
  .h5-welcome-profile-title {
    margin-bottom: 6px;
    font-size: 21px;
  }
  .h5-welcome-profile-desc {
    font-size: 13px;
    line-height: 1.5;
  }
  .h5-welcome-profile-body {
    margin-top: 18px;
    font-size: 15px;
  }
  .h5-welcome-highlights {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
    padding-top: 18px;
  }
  .h5-welcome-highlight {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
  }
}
.h5-icon-btn:focus-visible,
.h5-drawer-new-btn:focus-visible,
.h5-session-more:focus-visible,
.h5-send-btn:focus-visible,
.h5-attach-remove:focus-visible {
  outline: 2px solid var(--h5-accent, #6366f1);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .h5-app[data-h5-visual-style='editorial'] .h5-messages {
    padding-right: 20px;
    padding-left: 20px;
  }
}
      

@keyframes h5-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes h5-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes h5-toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.h5-spin {
  animation: h5-spin 1s linear infinite;
  transform-origin: center;
}

/* ─── H5 活动状态行（正文末尾弱提示）─── */

.h5-activity-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--h5-text-muted, #999);
  font-size: var(--h5-text-sm, 12px);
  line-height: 18px;
  opacity: 0.76;
}
.h5-activity-dot {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.6;
  animation: h5-activity-pulse 1.4s ease-in-out infinite;
}
@keyframes h5-activity-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 0.85; transform: scale(1); }
}
