/* 轻酒馆 · 聊天区：欢迎页、消息列表、消息正文、输入区、对话相关弹窗。 */

/* ---------- 顶栏标题 ---------- */

.topbar-title.is-home {
  cursor: default;
  letter-spacing: 0.08em;
}

.topbar-title.is-home:hover {
  background: none;
}

.chat-title .avatar {
  border: 1px solid var(--border);
}

.chat-title .sub::before {
  content: '·';
  margin-right: 8px;
  color: var(--text-faint);
}

.chat-title-caret {
  width: 15px;
  height: 15px;
  color: var(--text-faint);
}

/* ---------- 欢迎页 ---------- */

.welcome {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(24px, 8vh, 80px) 16px calc(32px + env(safe-area-inset-bottom));
}

.welcome-inner {
  width: min(620px, 100%);
  margin: 0 auto;
}

.welcome-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.welcome-brand h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.06em;
}

.welcome-brand p {
  margin: 2px 0 0;
  color: var(--text-faint);
  font-size: 14px;
}

.welcome section {
  margin-bottom: 26px;
}

.welcome-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.welcome-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

.welcome-step .grow {
  flex: 1;
  min-width: 0;
}

.welcome-step-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.welcome-step-title {
  font-weight: 600;
}

.welcome-empty {
  padding: 22px 0;
  text-align: center;
}

.welcome-empty p {
  margin: 0 0 12px;
}

.recent-item {
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 10px;
}

.recent-item .main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-item .title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.recent-item .title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.recent-item .when {
  flex: none;
}

.recent-item .desc {
  font-size: 13px;
}

.recent-item .desc b {
  color: var(--text-dim);
  font-weight: 500;
}

.more-hint {
  padding: 6px 10px;
}

/* ---------- 对话视图骨架 ---------- */

.chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
}

.chat-list {
  width: min(var(--chat-width), 100%);
  margin: 0 auto;
  padding: 18px 20px 28px;
}

.chat-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: var(--text-dim);
  text-align: center;
}

.chat-retry {
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}

/* ---------- 消息 ---------- */

.mes {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0 14px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: var(--radius);
}

.mes + .mes {
  margin-top: 4px;
}

.mes.user {
  background: color-mix(in srgb, var(--bg-raised) 70%, transparent);
}

.mes.system {
  border: 1px dashed var(--border);
}

.mes.editing {
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.mes-avatar {
  padding-top: 2px;
}

.mes-avatar .avatar {
  border: 1px solid var(--border);
}

.mes-main {
  min-width: 0;
}

.mes.is-hidden .mes-avatar,
.mes.is-hidden .mes-body,
.mes.is-hidden .mes-reasoning,
.mes.is-hidden .mes-name {
  opacity: 0.45;
}

.mes-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 2px;
}

.mes-name {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mes-time {
  flex: none;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.mes-hidden-tag {
  gap: 4px;
}

.mes-hidden-tag .icon {
  width: 13px;
  height: 13px;
}

.mes-actions {
  display: flex;
  gap: 0;
  margin: -4px -6px -4px 0;
  opacity: 0;
  transition: opacity 0.12s;
}

.mes:hover .mes-actions,
.mes:focus-within .mes-actions {
  opacity: 1;
}

.mes-actions .icon-btn {
  color: var(--text-faint);
}

.mes-actions .icon-btn:hover {
  color: var(--text);
}

@media (pointer: coarse) {
  .mes-actions {
    opacity: 0.75;
  }
}

.mes-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  margin-top: 6px;
}

.mes-meta {
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-faint);
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mes-swipes {
  display: flex;
  align-items: center;
  flex: none;
  margin-right: -6px;
}

.mes-swipes .count {
  min-width: 34px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.mes-swipes .icon-btn {
  color: var(--text-faint);
}

.mes-swipes .icon-btn:hover:not(:disabled) {
  color: var(--accent);
}

/* ---------- 正文排版 ---------- */

.mes-body {
  min-width: 0;
}

.mes-text {
  font-size: var(--chat-font-size);
  line-height: 1.78;
  overflow-wrap: anywhere;
  /* 消息里的 HTML 不能越界：固定定位、z-index、溢出都被关在这条消息内 */
  contain: layout paint;
  isolation: isolate;
  position: relative;
}

.mes-text > :first-child {
  margin-top: 0;
}

.mes-text > :last-child {
  margin-bottom: 0;
}

.mes-text p {
  margin: 0 0 0.85em;
}

.mes-text em,
.mes-text i {
  color: var(--emph);
}

.mes-text .q {
  color: var(--quote);
}

.mes-text strong {
  font-weight: 650;
}

.mes-text h1,
.mes-text h2,
.mes-text h3,
.mes-text h4 {
  margin: 1.1em 0 0.5em;
  line-height: 1.35;
}

.mes-text h1 {
  font-size: 1.35em;
}

.mes-text h2 {
  font-size: 1.22em;
}

.mes-text h3,
.mes-text h4 {
  font-size: 1.08em;
}

.mes-text ul,
.mes-text ol {
  margin: 0 0 0.85em;
  padding-left: 1.5em;
}

.mes-text li + li {
  margin-top: 0.2em;
}

.mes-text blockquote {
  margin: 0 0 0.85em;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-dim);
}

.mes-text code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-hover);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.mes-text pre {
  margin: 0 0 0.85em;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  overflow-x: auto;
  line-height: 1.5;
}

.mes-text pre code {
  padding: 0;
  background: none;
  font-size: 0.85em;
}

.mes-text hr {
  margin: 1.2em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.mes-text img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.mes-text table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 0.85em;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.5;
}

.mes-text th,
.mes-text td {
  padding: 5px 10px;
  border: 1px solid var(--border);
}

.mes-text th {
  background: var(--bg-hover);
}

.mes-text details {
  margin: 0 0 0.85em;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-raised) 60%, transparent);
}

.mes-text summary {
  cursor: pointer;
  color: var(--text-dim);
}

.mes-text a {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* 流式中的光标 */
.mes.streaming .mes-body .mes-text:not(.reasoning-text) > :last-child::after {
  content: '';
  display: inline-block;
  width: 0.45em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  border-radius: 1px;
  background: var(--accent);
  animation: caret 1s steps(2, start) infinite;
}

@keyframes caret {
  to {
    visibility: hidden;
  }
}

/* 等待第一个字时的三个点 */
.typing,
.dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 1.4em;
}

.typing i,
.dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: typing 1.2s ease-in-out infinite;
}

.dots i {
  width: 4px;
  height: 4px;
}

.typing i:nth-child(2),
.dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3),
.dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: none;
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* ---------- 思考块 ---------- */

.mes-reasoning {
  margin: 4px 0 10px;
  border-radius: var(--radius-sm);
}

.mes-reasoning > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.mes-reasoning > summary::-webkit-details-marker {
  display: none;
}

.mes-reasoning > summary:hover {
  background: var(--bg-hover);
}

.mes-reasoning > summary .icon {
  width: 15px;
  height: 15px;
}

.mes-reasoning.live > summary {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.mes-reasoning.live .dots i {
  background: var(--accent);
}

.mes-reasoning .reasoning-text {
  margin-top: 8px;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--border-strong);
  color: var(--text-dim);
  font-size: calc(var(--chat-font-size) * 0.88);
  line-height: 1.65;
  max-height: 50vh;
  overflow-y: auto;
}

.mes-reasoning .reasoning-text em,
.mes-reasoning .reasoning-text .q {
  color: inherit;
}

/* ---------- 就地编辑 ---------- */

.mes-editor .textarea {
  min-height: 120px;
  max-height: 60vh;
  font-size: var(--chat-font-size);
  line-height: 1.65;
  resize: vertical;
}

.mes-editor .row {
  margin-top: 8px;
}

/* ---------- 输入区 ---------- */

.chat-dock {
  flex: none;
  position: relative;
  padding: 6px 16px calc(12px + env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.chat-dock::before {
  /* 消息滚到输入区下方时的渐隐 */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 18px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.composer {
  position: relative;
  width: min(var(--chat-width), 100%);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--bg-input);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  transition: border-color 0.15s;
}

.composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border-strong));
}

/* 生成中：顶边一道缓慢流动的光 */
.composer.busy::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: busy-sweep 1.6s ease-in-out infinite;
}

@keyframes busy-sweep {
  from {
    background-position: -100% 0;
  }
  to {
    background-position: 200% 0;
  }
}

.composer-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 40vh;
  padding: 8px 4px;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--chat-font-size);
  line-height: 1.5;
  resize: none;
}

.composer-input:focus-visible {
  outline: 0;
}

.composer-input::placeholder {
  color: var(--text-faint);
}

.composer-input[readonly] {
  color: var(--text-dim);
}

.composer .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.composer-send {
  background: var(--accent);
  color: var(--accent-text) !important;
}

.composer-send:hover {
  background: var(--accent-hover) !important;
}

.composer-send.stop {
  background: var(--danger-soft);
  color: var(--danger) !important;
}

.composer-send.stop:hover {
  background: color-mix(in srgb, var(--danger) 24%, transparent) !important;
}

.composer-send.stop .icon {
  fill: currentColor;
}

.to-bottom {
  position: absolute;
  right: max(20px, calc(50% - var(--chat-width) / 2 + 4px));
  bottom: calc(100% + 10px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-panel);
  color: var(--text-dim);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.to-bottom.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-bottom:hover {
  color: var(--text);
}

/* ---------- 对话管理 / 开场白 ---------- */

/* 手机上弹窗的网格列按内容最大宽度撑开（见 app.css 的 .modal-backdrop），
   单行省略的长文本会把弹窗撑出屏幕；不让这些列表参与宽度计算 */
.chat-manage-list,
.pv-entries,
.greeting-list {
  contain: inline-size;
}

.chat-manage-list .list-item {
  align-items: flex-start;
  padding: 10px;
}

.chat-manage-list .title {
  font-weight: 600;
}

.chat-manage-list .desc {
  margin-top: 2px;
  font-size: 13px;
}

.chat-manage-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.hint {
  margin: 12px 0 0;
}

.greeting-hint {
  margin: 0 0 12px;
}

.greeting-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.greeting-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.greeting-item:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.greeting-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ---------- 本对话设置 ---------- */

.cs-summary {
  min-height: 160px;
}

.cs-summary-actions {
  flex-wrap: wrap;
  margin-top: -4px;
}

.cs-summary-actions .spinner {
  width: 14px;
  height: 14px;
}

.cs-depth {
  width: 120px;
}

.cs-books {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.cs-book {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
}

.cs-book:hover {
  background: var(--bg-hover);
}

.cs-book input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
}

.cs-book .grow {
  flex: 1;
  min-width: 0;
}

/* ---------- 提示词查看 ---------- */

.pv-intro {
  margin: 0 0 14px;
}

.pv-budget {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

.pv-budget-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.pv-budget-head b {
  font-size: 18px;
}

.pv-bar {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--bg-hover);
}

.pv-bar .seg {
  height: 100%;
  min-width: 2px;
}

.pv-bar .seg + .seg {
  border-left: 1px solid var(--bg-raised);
}

.pv-bar.over {
  box-shadow: 0 0 0 1px var(--danger);
}

.seg-other {
  background: #7c8aa5;
}

.seg-world {
  background: #5fae9b;
}

.seg-examples {
  background: #b48ad6;
}

.seg-history {
  background: var(--accent);
}

.pv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.pv-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pv-legend-item b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pv-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.pv-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
}

.pv-warn .icon {
  width: 16px;
  height: 16px;
}

.pv-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.pv-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-width: 0;
}

.pv-fact b {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-fact .chip {
  align-self: flex-start;
  margin-top: 2px;
}

.pv-note {
  margin: 8px 0 0;
}

.pv-entries {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.pv-entries.dropped {
  margin-top: 8px;
  border-style: dashed;
  opacity: 0.8;
}

.pv-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13.5px;
}

.pv-entry + .pv-entry {
  border-top: 1px solid var(--border);
}

.pv-entries.dropped .pv-entry-name {
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}

.pv-entry-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-msgs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pv-msg {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  overflow: hidden;
}

.pv-msg.role-system {
  border-left-color: #7c8aa5;
}

.pv-msg.role-user {
  border-left-color: #5fae9b;
}

.pv-msg.role-assistant {
  border-left-color: var(--accent);
}

.pv-msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.pv-msg-head:hover {
  background: var(--bg-hover);
}

.pv-msg-head .icon {
  width: 16px;
  height: 16px;
  color: var(--text-faint);
}

.pv-index {
  min-width: 20px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.pv-role {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.pv-src {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.pv-msg-body {
  margin: 0;
  padding: 4px 12px 10px 38px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-dim);
}

.pv-msg-body.clamped {
  max-height: 4.8em;
  overflow: hidden;
  cursor: pointer;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}

/* ---------- 手机 ---------- */

@media (max-width: 640px) {
  .chat-list {
    padding: 10px 12px 20px;
  }

  /* 头像缩进标题行，正文占满整行宽度 */
  .mes {
    display: block;
    position: relative;
    padding: 12px 10px;
    margin: 0 -6px;
  }

  .mes-avatar {
    position: absolute;
    top: 12px;
    left: 10px;
    padding: 0;
  }

  .mes-avatar .avatar {
    width: 30px !important;
    height: 30px !important;
    font-size: 13px !important;
  }

  .mes-head {
    min-height: 30px;
    padding-left: 40px;
    margin-bottom: 6px;
  }

  .mes-actions .icon-btn.small {
    width: 34px;
    height: 34px;
  }

  .mes-swipes .icon-btn.small {
    width: 38px;
    height: 34px;
  }

  .chat-dock {
    padding: 4px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .composer {
    border-radius: 14px;
  }

  /* iOS 输入框字号小于 16px 会自动放大页面 */
  .composer-input,
  .mes-editor .textarea {
    font-size: max(16px, var(--chat-font-size));
  }

  .hide-mobile {
    display: none;
  }

  .to-bottom {
    right: 14px;
  }

  .chat-title .sub {
    display: none;
  }

  .pv-msg-body {
    padding-left: 12px;
  }
}

/* ---------- 剧情回顾分界线 ---------- */

.summary-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  color: var(--text-faint);
  font-size: 12px;
}

.summary-divider::before,
.summary-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong));
}

.summary-divider::after {
  background: linear-gradient(to left, transparent, var(--border-strong));
}

/* ---------- 前端卡片（沙箱 iframe） ---------- */

.mes-text iframe.mes-card {
  display: block;
  width: 100%;
  height: 96px; /* 初始高度，内容就绪后由卡片上报的高度替换 */
  margin: 8px 0;
  border: 0;
  background: transparent;
  color-scheme: inherit;
}

.mes-card-pending {
  margin: 8px 0;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}
