/* 线下沉浸态 · 信纸长卷（复用 story-card 视觉语言） */

.offline-page {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.offline-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px calc(16px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

/* 场景卡 */
.offline-scene-card {
  padding: 0;
  overflow: hidden;
}

.offline-scene-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.offline-scene-label {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text);
  flex: 0 0 auto;
}

.offline-scene-summary {
  flex: 1;
  min-width: 0;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-scene-caret {
  flex: 0 0 auto;
  font-size: var(--font-xs);
  color: var(--text-hint);
}

.offline-scene-body {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px dashed var(--border);
}

/* hidden 属性需压过上面的 display:flex（作者类样式默认胜过 UA 的 [hidden]），否则收起无效 */
.offline-scene-body[hidden] {
  display: none;
}

.offline-scene-body .off-scene-save {
  align-self: flex-start;
}

/* 开场设定 */
.offline-setup {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.offline-setup .off-start {
  margin-top: 4px;
}

/* beat 流 · 信纸长卷 */
.offline-beats {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.offline-empty {
  text-align: center;
  padding: 32px 12px;
  font-size: var(--font-sm);
  color: var(--text-hint);
}

/* 手账日记 · 叙事条目（带小框） */
.offline-beat--narration {
  position: relative;
  margin-top: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)),
    var(--chat-paper);
  border: 1px solid var(--surface-card-border);
  border-radius: 16px;
  padding: 22px 18px 18px;
  box-shadow: var(--shadow-paper);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 31px,
    rgba(140, 115, 98, 0.045) 32px
  );
}

/* 内层手账小框：一层细虚线描边 */
.offline-beat--narration::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(140, 115, 98, 0.26);
  border-radius: 11px;
  pointer-events: none;
}

/* 顶部小标签（washi 胶带感） */
.offline-beat--narration::before {
  content: "线下手账";
  position: absolute;
  top: -9px;
  left: 16px;
  padding: 3px 11px;
  font-size: var(--font-xs);
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #f1b98f, #e2895f);
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(213, 138, 92, 0.3);
  transform: rotate(-2deg);
}

.offline-beat--narration p {
  position: relative;
  margin: 0 0 12px;
  padding: 0 4px;
  font-size: var(--font-md);
  line-height: 1.92;
  color: var(--text);
  text-indent: 2em;
}

.offline-beat--narration p:last-child {
  margin-bottom: 0;
}

/* 叙事正文里的翻译入口：紧跟在外语/方言词句后面，默认收起，点开才露出中文 */
.narration-translate-btn {
  display: inline;
  border: none;
  background: none;
  padding: 0 0 0 4px;
  margin: 0;
  font: inherit;
  font-size: 0.78em;
  line-height: 1;
  color: var(--text-accent, #c98a5c);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  text-indent: 0;
  cursor: pointer;
  vertical-align: 1px;
}

.narration-translate-btn:hover,
.narration-translate-btn:focus-visible {
  color: var(--text);
}

.narration-translation {
  display: inline;
  text-indent: 0;
  padding: 1px 4px;
  margin-left: 2px;
  border-radius: 6px;
  background: rgba(226, 137, 95, 0.12);
  color: var(--chat-translation-ink, var(--text-secondary, #8c7362));
  font-size: var(--chat-translation-font-size, 0.92em);
}

.narration-translation[hidden] {
  display: none;
}

.narration-translation::before {
  content: '〔';
  opacity: 0.55;
}

.narration-translation::after {
  content: '〕';
  opacity: 0.55;
}

.offline-beat-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 6px;
  position: relative;
  z-index: 1;
}

.offline-beat-edit,
.offline-beat-delete {
  border: none;
  background: transparent;
  color: var(--text-hint);
  font-size: var(--font-xs);
  padding: 4px 10px;
  cursor: pointer;
}

.offline-beat-edit:active,
.offline-beat-delete:active {
  color: var(--text-accent);
}

.offline-beat-delete {
  padding-left: 4px;
}

/* 流式输出闪烁光标 */
.offline-beat--narration.is-streaming p:last-child::after {
  content: "▌";
  margin-left: 1px;
  color: var(--text-accent, #c98a5c);
  animation: offlineStreamCaret 1s steps(2, start) infinite;
}

@keyframes offlineStreamCaret {
  50% { opacity: 0; }
}

/* 你的方向 · 像贴在页边的手写便签 */
.offline-beat--directive {
  align-self: flex-end;
  max-width: 82%;
  position: relative;
  background: rgba(241, 185, 143, 0.14);
  border: 1px solid rgba(241, 185, 143, 0.34);
  border-radius: 4px 12px 12px 12px;
  padding: 9px 13px;
  box-shadow: 0 2px 6px rgba(213, 138, 92, 0.12);
  transform: rotate(0.6deg);
}

.offline-beat--directive span {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-accent);
  margin-bottom: 2px;
}

.offline-beat--directive p,
.offline-beat--opening p,
.os-beat-multiline {
  margin: 0;
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.offline-beat--directive .offline-beat-actions {
  margin-top: 4px;
  padding-top: 0;
}

/* 你的开场 · 剧情由你写下第一句 */
.offline-beat--opening {
  align-self: flex-end;
  max-width: 88%;
  position: relative;
  background: rgba(255, 248, 240, 0.92);
  border: 1px solid rgba(226, 137, 95, 0.38);
  border-radius: 4px 14px 14px 14px;
  padding: 10px 14px 8px;
  box-shadow: 0 2px 8px rgba(213, 138, 92, 0.14);
  transform: rotate(-0.4deg);
}

.offline-beat--opening span {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-accent);
  margin-bottom: 4px;
  font-weight: 600;
}

.offline-beat--opening p {
  margin: 0;
  font-size: var(--font-md);
  line-height: 1.72;
  color: var(--text);
  white-space: pre-wrap;
}

.offline-beat--opening .offline-beat-actions {
  margin-top: 6px;
  padding-top: 0;
}

/* 活动类型分段下的旅行专属字段（出行天数 / 关键词查地点） */
.off-trip-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  margin-top: 2px;
  border: 1px dashed var(--surface-card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.55);
}

.off-trip-fields .off-query-place {
  align-self: flex-start;
}

.off-trip-fields[hidden] {
  display: none;
}

/* 顶部「第 N / 共 M 天」行程进度条 */
.offline-trip-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(241, 185, 143, 0.16);
  border: 1px solid rgba(241, 185, 143, 0.36);
  font-size: var(--font-sm);
  color: var(--text);
}

.offline-trip-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.offline-trip-day-summary {
  font-size: var(--font-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.offline-trip-day-stops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.offline-trip-stop-chip {
  font-size: var(--font-xs);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(241, 185, 143, 0.4);
  color: var(--text-muted);
}

.offline-trip-replan-btn {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--text-accent, #c98a5c);
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 2px 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(201, 138, 92, 0.4);
}

.offline-trip-replan-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 每日岔路 checkpoint 卡：预生成的选项，选完把结果交给角色续写，不是 AI 临时想的走向选项 */
.offline-trip-checkpoint {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(120, 160, 150, 0.12);
  border: 1px dashed rgba(120, 160, 150, 0.45);
}

.offline-trip-checkpoint-prompt {
  font-size: var(--font-sm);
  color: var(--text);
  line-height: 1.5;
}

.offline-trip-checkpoint-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offline-trip-checkpoint-opt {
  font-size: var(--font-sm);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(120, 160, 150, 0.5);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  cursor: pointer;
}

.offline-trip-checkpoint-opt:hover {
  background: rgba(120, 160, 150, 0.22);
}

/* 场景「更多设置」折叠开关 + 分组小标题 */
.off-more-toggle {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--text-accent, #c98a5c);
  font-size: var(--font-sm);
  font-weight: 600;
  padding: 4px 2px;
  cursor: pointer;
}

.off-more-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

.off-more-fields[hidden] {
  display: none;
}

.off-settings-divider {
  margin-top: 4px;
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-hint);
  letter-spacing: 0.03em;
}

/* 仅由相遇页显式开启的线下输入模式；共享机制组件在旅行等页面不会渲染这一组。 */
.off-encounter-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 2px 0 4px;
}

.off-mode-toggle {
  position: relative;
  min-width: 0;
  min-height: 76px;
  padding: 10px 9px;
  display: flex;
  align-items: flex-start;
  border: 1px solid var(--border-soft, rgba(15, 16, 18, 0.1));
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.off-mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.off-mode-toggle > span {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.off-mode-toggle strong {
  color: var(--text, #1b1c20);
  font-size: 12px;
  font-weight: 650;
}

.off-mode-toggle small {
  color: var(--text-hint, #7a7d86);
  font-size: 10px;
  line-height: 1.45;
}

.off-mode-toggle:has(input:checked) {
  border-color: var(--os-accent, #5c6b8a);
  background: var(--os-accent-soft, rgba(92, 107, 138, 0.09));
}

.off-mode-toggle:has(input:checked) strong {
  color: var(--os-accent, #5c6b8a);
}

.off-mode-toggle:focus-within {
  outline: 2px solid color-mix(in srgb, var(--os-accent, #5c6b8a) 40%, transparent);
  outline-offset: 2px;
}

@media (max-width: 430px) {
  .off-encounter-modes {
    grid-template-columns: 1fr;
  }

  .off-mode-toggle {
    min-height: 58px;
  }
}

.off-field-hint {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-hint);
}

select.off-scene-worldbook[multiple],
select.off-scene-preset-style[multiple] {
  height: auto;
  padding: 4px;
}

select.off-scene-worldbook[multiple] option,
select.off-scene-preset-style[multiple] option {
  padding: 6px 8px;
  border-radius: 6px;
}

/* 场景预设条 */
.off-preset-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.off-preset-bar .off-preset-select {
  flex: 1 1 auto;
  min-width: 0;
}

/* beat 场景图 */
.offline-beat-image {
  margin-top: 10px;
}

.offline-beat-image--error {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c-ink, #2a2622) 6%, transparent);
  font-size: 13px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--c-ink, #2a2622) 72%, transparent);
}

.offline-beat-image--error p {
  margin: 0;
}

.offline-beat-image img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--surface-card-border);
  cursor: zoom-in;
}

.offline-html-widgets {
  display: grid;
  gap: 8px;
  margin: 12px 0 4px;
}

.offline-html-widget {
  min-width: 0;
}

.offline-beat-image-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.offline-beat-audio {
  display: block;
  width: 100%;
  margin-top: 8px;
}

/* 「叫TA也来」角色选择弹层 */
.offline-add-participant-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offline-add-participant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft, #ece0d6);
  border-radius: var(--radius-md, 12px);
  background: var(--surface, #fdf8f4);
  font-size: var(--font-sm);
  color: var(--text);
}

.offline-attendance-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-add-participant-row > em {
  flex: 0 0 auto;
  color: var(--text-hint);
  font-size: var(--font-xs);
  font-style: normal;
}

.offline-attendance-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.offline-add-participant-row .btn {
  flex: 0 0 auto;
}

button.offline-add-participant-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

/* 手机插曲 · 折进现场时间线的一小段线上往来 */
.offline-beat--interlude {
  align-self: stretch;
  background: rgba(126, 140, 160, 0.08);
  border: 1px dashed rgba(126, 140, 160, 0.35);
  border-radius: 10px;
  padding: 9px 13px;
}

.offline-beat--interlude span {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-hint);
  margin-bottom: 3px;
}

.offline-beat--interlude p {
  margin: 0;
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.offline-beat--interlude .offline-beat-actions {
  margin-top: 4px;
  padding-top: 0;
}

/* 底部推进栏 */
.offline-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: var(--bg-sheet);
  border-top: 1px solid var(--border);
}

.offline-scene-autofill {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font-size: var(--font-sm, 13px);
  color: var(--text-muted, #8a7f76);
}
.offline-scene-autofill strong {
  color: var(--text, #2b2420);
  font-weight: 600;
}

.offline-navbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.offline-settings-sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.offline-settings-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 22, 18, 0.36);
}
.offline-settings-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 18px 18px 0 0;
  background: var(--bg-sheet, #fbf7f2);
  box-shadow: 0 -12px 40px rgba(40, 28, 18, 0.18);
}
.offline-settings-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-soft, #ece0d6);
}
.offline-settings-sheet-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}
.offline-settings-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 20px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.offline-settings-sheet-foot {
  flex: 0 0 auto;
  padding: 10px 16px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border-soft, #ece0d6);
  background: var(--bg-sheet, #fbf7f2);
}
.offline-settings-sheet-foot .btn {
  width: 100%;
}

.offline-page--trip .offline-settings-sheet-panel,
.offline-page--trip .offline-settings-sheet-foot {
  background: #f7fbfa;
}

/* 输入框包裹层：末尾内嵌展开按钮 */
.offline-bar .offline-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.offline-bar .offline-input-wrap .offline-directive {
  width: 100%;
  min-height: 38px;
  max-height: 132px;
  padding: 8px 38px 8px 12px;
  resize: none;
  overflow-y: auto;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  field-sizing: content;
}

/* 输入框末尾的展开大输入框按钮（多行时贴右下，图标用 SVG 避免字符基线歪斜） */
.offline-bar .offline-expand {
  position: absolute;
  right: 4px;
  bottom: 4px;
  top: auto;
  transform: none;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-hint);
  line-height: 0;
  cursor: pointer;
}

.offline-bar .offline-expand .svg-icon {
  width: 16px;
  height: 16px;
}

.offline-bar .offline-expand:active {
  color: var(--accent, #e2895f);
}

/* 左侧 + 工具按钮 */
.offline-bar .offline-plus {
  flex: 0 0 auto;
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft, #ece0d6);
  border-radius: 50%;
  background: var(--surface, #fdf8f4);
  color: var(--text-secondary);
  cursor: pointer;
}

.offline-bar .offline-plus .svg-icon {
  width: 20px;
  height: 20px;
}

/* 图标推进按钮（仅图标，不带文字） */
.offline-bar .offline-advance {
  flex: 0 0 auto;
  width: 46px;
  min-width: 46px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.offline-bar .offline-advance .svg-icon {
  width: 20px;
  height: 20px;
}

.offline-bar .offline-advance.is-loading {
  opacity: 0.55;
}

/* + 展开的工具栏 */
.offline-tools {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-sheet);
  border-top: 1px solid var(--border-soft, #ece0d6);
}

.offline-tools[hidden] {
  display: none;
}

.offline-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border-soft, #ece0d6);
  border-radius: var(--radius-md, 12px);
  background: var(--surface, #fdf8f4);
  color: var(--text);
  font-size: var(--font-sm);
  cursor: pointer;
  overflow: hidden;
}

.offline-tool .svg-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--text-secondary);
}

.offline-tool > span {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offline-tool .offline-tool-state {
  flex: 0 0 auto;
  font-style: normal;
  font-size: var(--font-xs);
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(241, 185, 143, 0.22);
  color: var(--accent, #e2895f);
}

.offline-tool:disabled {
  opacity: 0.42;
  cursor: default;
}

.offline-stop:not(:disabled) {
  border-color: rgba(169, 91, 88, 0.34);
  color: #a95b58;
}

.offline-stop:not(:disabled) .svg-icon {
  color: #a95b58;
}

/* 文末推进选项（ABC 快捷走向） */
.offline-options {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 0;
  background: var(--bg-sheet);
}

.offline-options-loading {
  font-size: var(--font-xs);
  color: var(--text-hint);
  padding: 4px 2px;
}

.offline-options-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.offline-options-title {
  font-size: var(--font-xs);
  color: var(--text-hint);
}

.offline-options-collapse {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-xs);
  cursor: pointer;
  padding: 2px 4px;
}

.offline-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.offline-options-pending {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 2px;
}

.offline-options-pending i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--os-accent, var(--text-accent));
  animation: offlineOptionPending 1s ease-in-out infinite;
}

.offline-options-pending i:nth-child(2) { animation-delay: 140ms; }
.offline-options-pending i:nth-child(3) { animation-delay: 280ms; }

@keyframes offlineOptionPending {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}

.offline-options-list[hidden] {
  display: none;
}

.offline-option-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid var(--border-soft, #ece0d6);
  border-radius: var(--radius-md, 12px);
  background: var(--surface, #fdf8f4);
  color: var(--text);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.offline-option-chip:disabled {
  cursor: wait;
  opacity: 0.72;
}

.offline-option-chip:active {
  background: rgba(241, 185, 143, 0.18);
  border-color: rgba(241, 185, 143, 0.5);
}

.offline-option-chip b {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(241, 185, 143, 0.25);
  color: var(--accent, #e2895f);
  font-size: var(--font-xs);
}

.offline-option-chip span {
  flex: 1 1 auto;
  min-width: 0;
}

/* 通用开关行（推进选项开关等） */
.off-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.off-toggle-row input {
  flex: 0 0 auto;
}

/* 番外会话顶部「推进选项」开关 */
.offline-options-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  cursor: pointer;
}

/* 番外创建：自定义主题面板 */
.au-custom-theme {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 2px;
}

.au-custom-theme[hidden] {
  display: none;
}

/* 叙事设置：视角 / 人称 分段 */
.off-seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.off-seg-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border-soft, #ece0d6);
  border-radius: var(--radius-md, 12px);
  background: var(--surface, #fdf8f4);
  color: var(--text-secondary);
  font-size: var(--font-xs);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.off-seg-btn.is-active {
  background: rgba(241, 185, 143, 0.18);
  border-color: rgba(241, 185, 143, 0.5);
  color: var(--text-accent, #c98a5c);
  font-weight: 600;
}

.off-num-row {
  display: flex;
  gap: 8px;
}

.off-num-row .off-num {
  flex: 1;
  min-width: 0;
}

.off-num-row .off-num .form-input {
  width: 100%;
}

/* ============ 线下邀约卡（聊天框内） ============ */
.offline-invite-card {
  position: relative;
  width: min(78vw, 280px);
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

.offline-invite-card-ribbon {
  position: absolute;
  top: -9px;
  left: 16px;
  z-index: 2;
  padding: 3px 12px;
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(135deg, #f1b98f, #e89a78);
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(213, 138, 92, 0.35);
}

.offline-invite-card-paper {
  position: relative;
  margin-top: 4px;
  padding: 20px 16px 14px;
  background:
    radial-gradient(circle at 0 50%, transparent 6px, var(--chat-paper, #fffaf4) 6px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 6px, var(--chat-paper, #fffaf4) 6px) right / 51% 100% no-repeat;
  border: 1px solid var(--surface-card-border, #ecdccb);
  border-radius: 14px;
  box-shadow: var(--shadow-paper, 0 6px 18px rgba(150, 110, 80, 0.14));
}

.offline-invite-card-paper::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 40px;
  border-top: 1px dashed rgba(180, 140, 110, 0.4);
}

.offline-invite-card-head {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--text);
}

.offline-invite-card-meta {
  margin-top: 4px;
  font-size: var(--font-xs);
  color: var(--text-accent, #c98a5c);
}

.offline-invite-card-act {
  margin-top: 6px;
  font-size: var(--font-sm);
  color: var(--text);
}

.offline-invite-card-note {
  margin-top: 6px;
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--text-secondary);
}

.offline-invite-card-route {
  margin-top: 6px;
  font-size: var(--font-xs);
  line-height: 1.5;
  color: var(--text-secondary);
  opacity: 0.85;
}

.offline-invite-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.offline-invite-card-actions button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
}

.offline-invite-accept,
.offline-invite-enter {
  color: #fff;
  background: linear-gradient(135deg, #f1b98f, #e2895f);
  box-shadow: 0 3px 10px rgba(213, 138, 92, 0.32);
}

.offline-invite-decline,
.offline-invite-shelve {
  color: var(--text-secondary);
  background: var(--surface, #f6ece2);
  border: 1px solid var(--border-soft, #ece0d6) !important;
}

.offline-invite-shelve {
  color: var(--text-hint, #a9968a);
}

.offline-invite-card-actions--triple button {
  padding: 8px 6px;
  font-size: var(--font-xs);
}

.offline-invite-card-status {
  margin-top: 12px;
  text-align: center;
  font-size: var(--font-xs);
  color: var(--text-hint);
}

.offline-invite-card-status.is-shelved {
  margin-top: 0;
  margin-bottom: 8px;
}

.offline-invite-card--declined .offline-invite-card-paper {
  opacity: 0.72;
  filter: grayscale(0.2);
}

.offline-invite-card--group .offline-invite-card-ribbon {
  background: linear-gradient(135deg, #8eb8d8, #6a9fc4);
}

.offline-invite-card-invitees {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.offline-invite-invitee-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  background: rgba(140, 115, 98, 0.08);
  border: 1px solid rgba(140, 115, 98, 0.14);
}

.offline-invite-card-actions--double {
  grid-template-columns: 1fr 1fr;
}

.offline-invite-card-responses {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.offline-invite-response {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(140, 115, 98, 0.12);
  opacity: 0;
  transform: translateY(6px);
  animation: offline-invite-response-in 0.45s ease forwards;
}

.offline-invite-response:nth-child(2) { animation-delay: 0.08s; }
.offline-invite-response:nth-child(3) { animation-delay: 0.16s; }
.offline-invite-response:nth-child(4) { animation-delay: 0.24s; }

.offline-invite-response.is-attending .offline-invite-response-avatar {
  background: linear-gradient(135deg, #8fd3a8, #5fbf86);
  color: #fff;
}

.offline-invite-response.is-skip .offline-invite-response-avatar {
  background: rgba(140, 115, 98, 0.16);
  color: var(--text-hint);
}

.offline-invite-response-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.offline-invite-response-body {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: var(--font-xs);
  line-height: 1.45;
}

.offline-invite-response-body strong {
  font-weight: 700;
}

.offline-invite-response-body em {
  margin-left: 6px;
  font-style: normal;
  font-size: 11px;
  color: var(--text-hint);
}

.offline-invite-response-body small {
  color: var(--text-secondary);
}

.offline-invite-card-responses.is-loading {
  opacity: 0.72;
}

@keyframes offline-invite-response-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .offline-invite-response {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ============ 线下页 · 邀约 banner（赴约仪式感） ============ */
.offline-invite-banner {
  position: relative;
  margin-bottom: 12px;
  padding: 18px 16px 14px;
  background: linear-gradient(160deg, rgba(241, 185, 143, 0.16), rgba(255, 250, 244, 0.9));
  border: 1px solid rgba(241, 185, 143, 0.4);
  overflow: visible;
}

.offline-invite-banner-ribbon {
  position: absolute;
  top: -10px;
  left: 16px;
  padding: 3px 12px;
  font-size: var(--font-xs);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f1b98f, #e89a78);
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(213, 138, 92, 0.35);
}

.offline-invite-banner-meta {
  margin-top: 4px;
  font-size: var(--font-sm);
  color: var(--text-accent, #c98a5c);
}

.offline-invite-banner-act {
  margin-top: 6px;
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text);
}

.offline-invite-banner-note {
  margin-top: 6px;
  font-size: var(--font-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

.offline-invite-banner-route {
  margin-top: 8px;
  font-size: var(--font-xs);
  line-height: 1.5;
  color: var(--text-secondary);
  opacity: 0.85;
}

/* ============ 发起邀约模态 ============ */
.offline-invite-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offline-invite-sheet-ribbon {
  align-self: flex-start;
  padding: 3px 12px;
  font-size: var(--font-xs);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f1b98f, #e89a78);
  border-radius: 999px;
}

.offline-invite-sheet-body .oi-send {
  margin-top: 4px;
}

/* ============ 邀约结束 ============ */
.offline-done-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.offline-done-card {
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 22px 18px;
  text-align: center;
}

.offline-done-ribbon {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(241, 185, 143, 0.28);
  color: #b85c5c;
  font-size: 12px;
  font-weight: 800;
}

.offline-done-title {
  margin: 14px 0 8px;
  font-size: 18px;
  line-height: 1.45;
}

.offline-done-summary {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: left;
}

.offline-done-note {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-hint);
}

.offline-done-actions {
  display: grid;
  gap: 8px;
}

/* ============ 约会档案详情 ============ */
.oda-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 12px;
  padding: 12px 12px calc(12px + var(--safe-bottom));
}

.oda-head-card,
.oda-summary-card {
  padding: 16px;
}

.oda-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.oda-ribbon {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(241, 185, 143, 0.24);
  font-size: 11px;
  font-weight: 700;
  color: #b85c5c;
}

.oda-title {
  margin: 10px 0 6px;
  font-size: 18px;
  line-height: 1.45;
}

.oda-meta,
.oda-section-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.oda-summary {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.75;
}

.oda-view-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-card);
}

.oda-view-switch button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
}

.oda-view-switch button.is-active {
  background: var(--bg-secondary);
  color: var(--text);
  font-weight: 700;
}

.oda-view-switch button:focus-visible,
.oda-memory-person:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
}

.oda-view-content {
  display: grid;
  gap: 12px;
}

/* 结构化卷宗：核心锚点分组 */
.oda-dossier-card {
  padding: 16px;
}

.oda-dossier-cast {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.oda-dossier-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.oda-dossier-group-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-hint);
  margin-bottom: 4px;
}

.oda-dossier-group p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

.oda-dossier-story {
  white-space: pre-wrap;
}

.oda-rounds {
  display: grid;
  gap: 10px;
}

.oda-round {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px dashed rgba(140, 115, 98, 0.16);
}

.oda-round--directive {
  background: rgba(255, 240, 230, 0.72);
}

.oda-round--opening {
  background: rgba(255, 248, 240, 0.88);
  border-color: rgba(226, 137, 95, 0.22);
}

.oda-round--attendance {
  background: var(--bg-card);
  border-style: solid;
  border-color: var(--border-soft);
}

.oda-round-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.oda-round p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.75;
}

.oda-round p:last-child {
  margin-bottom: 0;
}

.oda-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-hint);
  font-size: 13px;
}

.oda-memory-card {
  padding: 16px;
}

.oda-memory-people {
  display: flex;
  gap: 6px;
  margin: -4px 0 14px;
  overflow-x: auto;
}

.oda-memory-person {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
}

.oda-memory-person.is-active {
  border-color: var(--text-accent);
  color: var(--text-accent);
}

.oda-memory-range {
  margin-top: 6px;
  color: var(--text-hint);
  font-size: 11px;
}

.oda-memory-text {
  margin: 10px 0 0;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
}

/* ============ 我们的记录 · 相遇列表 ============ */
.odl-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px calc(16px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.odl-filter .odl-char-select {
  width: 100%;
}

.odl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.odl-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--surface-card-border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
}

.odl-item.is-favorite {
  border-color: rgba(241, 185, 143, 0.6);
  background: rgba(241, 185, 143, 0.08);
}

.odl-item-fav {
  flex: 0 0 auto;
  color: #e2895f;
}

.odl-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.odl-item-body strong {
  font-size: var(--font-sm);
  color: var(--text);
}

.odl-item-body small {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.odl-item-body p {
  margin: 2px 0 0;
  font-size: var(--font-xs);
  line-height: 1.5;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.odl-empty {
  padding: 32px 12px;
  text-align: center;
  font-size: var(--font-sm);
  color: var(--text-hint);
}

/* chat-details 小提示 */
.chat-details-hint {
  padding: 0 2px 4px;
  font-size: var(--font-xs);
  line-height: 1.5;
  color: var(--text-hint);
}

/* ============ 无进行中会话时的空态 ============ */
.offline-empty-state {
  margin-top: 20vh;
  padding: 28px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.offline-empty-state p {
  margin: 0;
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* ============ 设置未调整提醒横幅 ============ */
.offline-settings-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 8px 9px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(241, 185, 143, 0.22), rgba(226, 137, 95, 0.14));
  border: 1px solid rgba(241, 185, 143, 0.5);
  font-size: var(--font-xs);
  color: var(--text);
}

.offline-settings-hint span {
  flex: 1;
  min-width: 0;
}

.offline-settings-hint-open {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--text-accent, #c98a5c);
  font-size: var(--font-xs);
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
}

.offline-settings-hint-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-hint);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

/* ============ 日期分隔 beat（一起旅行 · 推进到下一天） ============ */
.offline-beat--daymark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 0;
}

.offline-beat--daymark span {
  padding: 4px 16px;
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-accent, #c98a5c);
  background: rgba(241, 185, 143, 0.16);
  border: 1px dashed rgba(241, 185, 143, 0.55);
  border-radius: 999px;
}

/* ============ 一起旅行 · ins 白卡视觉变体（Phase E2，限定在 .offline-page--trip 作用域内）
   脱离奶油手账底色/repeating 网格线/washi 胶带；主色调保留青绿——沿用旧版
   "一起旅行=青绿，旅行char=赭石"这套区分。不影响"约线下"本身仍用的手账体系。 ============ */
.offline-page--trip {
  --text: #17181b;
  --text-secondary: #6c6e74;
  --text-hint: rgba(21, 22, 26, 0.44);
  --text-muted: #6c6e74;
  --text-accent: #3f6b60;
  --accent: #3f6b60;
  --border: rgba(15, 16, 18, 0.1);
  --border-soft: rgba(15, 16, 18, 0.08);
  --surface-card-border: rgba(15, 16, 18, 0.08);
  --surface: #ffffff;
  --chat-paper: #ffffff;
  --bg-sheet: #ffffff;
  --bg-card: #ffffff;
  --shadow-paper: 0 1px 2px rgba(15, 16, 18, 0.04), 0 8px 20px rgba(15, 16, 18, 0.05);
}

.offline-page--trip .offline-scene-card {
  border-color: rgba(15, 16, 18, 0.08);
}

.offline-page--trip .offline-trip-progress {
  position: relative;
  background: #fff;
  border: 1px solid rgba(63, 107, 96, 0.28);
}

.offline-page--trip .offline-trip-stop-chip {
  background: rgba(63, 107, 96, 0.07);
  border-color: rgba(63, 107, 96, 0.28);
  color: var(--text-secondary);
}

.offline-page--trip .offline-trip-replan-btn {
  color: #3f6b60;
  text-decoration-color: rgba(63, 107, 96, 0.4);
}

.offline-page--trip .offline-trip-checkpoint {
  background: rgba(63, 107, 96, 0.06);
  border: 1px dashed rgba(63, 107, 96, 0.4);
}

.offline-page--trip .offline-trip-checkpoint-opt {
  border-color: rgba(63, 107, 96, 0.45);
  background: #fff;
}

.offline-page--trip .offline-trip-checkpoint-opt:hover {
  background: rgba(63, 107, 96, 0.12);
}

.offline-page--trip .offline-beat--daymark span {
  color: #3f6b60;
  background: rgba(63, 107, 96, 0.08);
  border: 1px dashed rgba(63, 107, 96, 0.4);
}

.offline-page--trip .offline-beat--narration {
  background: #ffffff;
  border: 1px solid rgba(15, 16, 18, 0.08);
  background-image: none;
}

.offline-page--trip .offline-beat--narration::after {
  content: none;
}

.offline-page--trip .offline-beat--narration::before {
  content: "旅行手账";
  color: #fff;
  background: #3f6b60;
  box-shadow: none;
  transform: none;
}

.offline-page--trip .offline-beat--narration.is-streaming p:last-child::after {
  color: #3f6b60;
}

.offline-page--trip .offline-beat--directive {
  background: rgba(15, 16, 18, 0.05);
  border: 1px solid rgba(15, 16, 18, 0.1);
  box-shadow: none;
  transform: none;
}

.offline-page--trip .offline-beat--directive span {
  color: #3f6b60;
}

.offline-page--trip .offline-beat--opening {
  background: #ffffff;
  border: 1px solid rgba(15, 16, 18, 0.12);
  box-shadow: var(--shadow-paper);
  transform: none;
}

.offline-page--trip .offline-beat--opening span {
  color: #3f6b60;
}

.offline-page--trip .off-trip-fields {
  background: #fafaf9;
  border-color: rgba(15, 16, 18, 0.1);
}

.offline-page--trip .off-more-toggle,
.offline-page--trip .narration-translate-btn {
  color: #3f6b60;
}

.offline-page--trip .narration-translation {
  background: rgba(63, 107, 96, 0.1);
}

.offline-page--trip .offline-bar {
  background: #ffffff;
}

.offline-page--trip .offline-plus {
  background: #fff;
}

.offline-page--trip .offline-tools {
  background: #ffffff;
}

.offline-page--trip .offline-invite-banner {
  background: #ffffff;
  border-color: rgba(63, 107, 96, 0.3);
}

.offline-page--trip .offline-invite-banner-ribbon {
  background: #3f6b60;
  box-shadow: none;
}

.offline-page--trip .offline-invite-banner-meta {
  color: #3f6b60;
}

.offline-page--trip .offline-settings-hint {
  background: rgba(63, 107, 96, 0.08);
  border-color: rgba(63, 107, 96, 0.32);
}

.offline-page--trip .offline-settings-hint-open {
  color: #3f6b60;
}

.offline-page--trip .navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(15, 16, 18, 0.08);
}

.offline-page--trip .navbar-title {
  color: var(--text);
}

.offline-page--trip .navbar-btn {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-paper);
}

.offline-page--trip {
  background: #f6f5f3;
}

.offline-page--trip .offline-options {
  background: #ffffff;
}

.offline-page--trip .offline-option-chip:active {
  background: rgba(63, 107, 96, 0.14);
  border-color: rgba(63, 107, 96, 0.4);
}

.offline-page--trip .offline-option-chip b {
  background: rgba(63, 107, 96, 0.16);
  color: #3f6b60;
}

/* ============ 总结收纳确认 · 可选时间线推进 ============ */
.off-settle-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.off-settle-hint,
.off-settle-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-hint);
  line-height: 1.45;
}

.off-settle-keep-virtual {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.off-settle-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 赴约自动回复 · 叙事设置里的档位 */
.off-auto-reply-global {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============ P3 · 线下沉浸页「相遇」皮（限定 .offline-session-page，不影响旅行/其它页）
   主体：虚拟现实里真实发生过的一段线下时空。ins 系克制方向，有意偏离全站奶油手账。
   签名元素：时空锚（地点 · 时间 · 同行 的小字锚行）+ beat 之间的菱形针脚（时间线的缝合点）。
   token 溯源（v2，回应「还是奶油风」的反馈）：
   - 底 #ffffff 纯白默认（可切暖纸/暮色）；chrome 一律干净黑体栈，摆脱全局楷体的手账感；
   - 墨 #1a1b1e / 次墨 #72737a / 淡墨 40%（正文串行阅读态）；
   - 强调「暮色蓝」#5c6b8a——傍晚见面、路灯未亮时的天色，只用在时空锚/方向墨线/小状态上；
   - 主按钮石墨 #17181b（与旅行皮黑按钮同语系），不再用全局奶油橙；
   - 正文默认衬线 16px/1.9，措施上限 42em；字号/行距/宽度/底色/底图/自定义 CSS 由用户偏好覆盖。 ============ */
.offline-session-page {
  --os-paper: #ffffff;
  --os-ink: #1a1b1e;
  --os-ink-2: #72737a;
  --os-ink-3: rgba(26, 27, 30, 0.4);
  --os-line: rgba(26, 27, 30, 0.08);
  --os-accent: #5c6b8a;
  --os-accent-soft: rgba(92, 107, 138, 0.1);
  --os-btn: #17181b;
  --os-btn-ink: #ffffff;
  --os-serif: Georgia, "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --os-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --os-body-size: 16px;
  --os-leading: 1.9;
  --os-measure: 42em;

  /* 把通用变量映射进新 token，让既有组件在作用域内自动换装 */
  --text: var(--os-ink);
  --text-secondary: var(--os-ink-2);
  --text-hint: var(--os-ink-3);
  --text-muted: var(--os-ink-2);
  --text-accent: var(--os-accent);
  --accent: var(--os-accent);
  --border: var(--os-line);
  --border-soft: var(--os-line);
  --surface-card-border: var(--os-line);
  --surface: #ffffff;
  --surface-card: #ffffff;
  --bg-sheet: var(--os-paper);
  --bg-card: #ffffff;
  --chat-paper: transparent;
  --shadow-paper: 0 1px 2px rgba(15, 16, 18, 0.04);

  font-family: var(--os-sans);
  background: var(--os-paper);
}

.offline-session-page[data-os-bg="white"] {
  --os-paper: #ffffff;
}

.offline-session-page[data-os-bg="paper"] {
  --os-paper: #faf9f7;
}

/* 自定义底图：图上盖一层可调浓度的纸色蒙版，保证正文可读 */
.offline-session-page[data-os-has-bg="1"] {
  isolation: isolate;
  background-image: none;
}

.offline-session-page[data-os-has-bg="1"]::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--os-veil, rgba(255, 255, 255, 0.88)), var(--os-veil, rgba(255, 255, 255, 0.88))), var(--os-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.offline-session-page[data-os-has-bg="1"] > :not(.offline-settings-sheet) {
  position: relative;
  z-index: 1;
}

.offline-session-page[data-os-has-bg="1"] .navbar,
.offline-session-page[data-os-has-bg="1"] .offline-bar,
.offline-session-page[data-os-has-bg="1"] .offline-tools,
.offline-session-page[data-os-has-bg="1"] .offline-options,
.offline-session-page[data-os-has-bg="1"] .os-manage-bar {
  background: transparent !important;
  background-image: none !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.offline-session-page[data-os-bg="dusk"] {
  --os-paper: #191a1d;
  --os-ink: #e9e7e2;
  --os-ink-2: #a3a19c;
  --os-ink-3: rgba(233, 231, 226, 0.42);
  --os-line: rgba(233, 231, 226, 0.14);
  --os-accent: #8b9cc4;
  --os-accent-soft: rgba(139, 156, 196, 0.16);
  --os-btn: #e9e7e2;
  --os-btn-ink: #191a1d;
  --os-veil: rgba(25, 26, 29, 0.82);
  --surface: #222327;
  --surface-card: #222327;
  --bg-card: #202124;
  --shadow-paper: none;
}

/* 按钮统一改石墨/发丝线，摆脱全局奶油橙按钮 */
.offline-session-page .btn-primary {
  background: var(--os-btn);
  border-color: var(--os-btn);
  color: var(--os-btn-ink);
  box-shadow: none;
}

.offline-session-page .btn-outline,
.offline-session-page .btn-soft {
  background: transparent;
  border: 1px solid var(--os-line);
  color: var(--os-ink-2);
  box-shadow: none;
}

.offline-session-page[data-os-bg="dusk"] .form-input {
  background: #26272b;
  color: var(--os-ink);
  border-color: var(--os-line);
}

/* 导航条：融进纸面，细线收边 */
.offline-session-page .navbar {
  background: var(--os-paper);
  border-bottom: 1px solid var(--os-line);
}

.offline-session-page .navbar-title {
  color: var(--os-ink);
}

.offline-session-page .navbar-btn {
  background: transparent;
  color: var(--os-ink-2);
  box-shadow: none;
}

/* 线下页右侧有时会放两枚操作按钮；标题按整条导航栏居中，而非按剩余空间居中。 */
.offline-page > .navbar {
  position: sticky;
}

.offline-page > .navbar > .navbar-title {
  position: absolute;
  left: 50%;
  width: calc(100% - 180px);
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
}

.offline-page > .navbar > :last-child:not(.navbar-title) {
  margin-left: auto;
}

/* 阅读栏宽：正文与场景卡限宽居中 */
.offline-session-page .offline-scroll {
  padding: 14px 18px calc(20px + var(--safe-bottom));
}

.offline-session-page .os-anchor,
.offline-session-page .offline-invite-banner,
.offline-session-page .offline-settings-hint,
.offline-session-page .offline-scene-card,
.offline-session-page .offline-beats {
  width: 100%;
  max-width: var(--os-measure);
  margin-left: auto;
  margin-right: auto;
}

/* 时空锚：签名元素，一行小字钉住这段相遇的时空 */
.os-anchor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--os-ink-3, rgba(31, 32, 35, 0.45));
}

.os-anchor-mark {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border: 1px solid var(--os-accent, #9a5b3c);
  transform: rotate(45deg);
}

.os-anchor-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-anchor-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 7px;
  vertical-align: 2px;
  border-radius: 50%;
  background: currentColor;
  font-style: normal;
}

.offline-session-page[data-os-anchor="off"] .os-anchor {
  display: none;
}

/* 场景卡与邀约条：白卡细线，去掉奶油投影 */
.offline-session-page .offline-scene-card {
  background: var(--surface);
  border: 1px solid var(--os-line);
  border-radius: 14px;
  box-shadow: none;
}

.offline-session-page .offline-invite-banner {
  background: var(--surface);
  border: 1px solid var(--os-line);
  border-radius: 14px;
}

.offline-session-page .offline-invite-banner-ribbon {
  background: var(--os-accent);
  box-shadow: none;
}

.offline-session-page .offline-settings-hint {
  background: var(--os-accent-soft);
  border-color: var(--os-line);
}

/* 叙事：去小框，串行阅读态；衬线正文，字号行距吃用户偏好 */
.offline-session-page .offline-beat--narration {
  margin-top: 0;
  padding: 4px 2px 2px;
  background: none;
  background-image: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.offline-session-page .offline-beat--narration::after {
  content: none;
}

/* 菱形针脚：每段叙事前的缝合点；若这轮带「你的方向」，针脚让位给方向块 */
.offline-session-page .offline-beat--narration::before {
  content: "";
  position: static;
  display: block;
  width: 5px;
  height: 5px;
  margin: 4px auto 18px;
  padding: 0;
  background: none;
  border: 1px solid var(--os-line);
  border-radius: 0;
  box-shadow: none;
  transform: rotate(45deg);
}

.offline-session-page .offline-beat--narration:first-child::before,
.offline-session-page .offline-beat--directive + .offline-beat--narration::before,
.offline-session-page .offline-beat--narration.is-streaming::before,
.offline-session-page[data-os-anchor="off"] .offline-beat--narration::before {
  display: none;
}

.offline-session-page .offline-beat--narration p {
  padding: 0;
  font-family: var(--os-serif);
  font-size: var(--os-body-size);
  line-height: var(--os-leading);
  text-indent: 0;
  color: var(--os-ink);
  margin: 0 0 0.9em;
}

.offline-session-page[data-os-font="sans"] .offline-beat--narration p {
  font-family: inherit;
}

/* 你的开场 / 你的方向：右缘一道墨线，安静地站在页边 */
.offline-session-page .offline-beat--opening,
.offline-session-page .offline-beat--directive {
  background: none;
  border: none;
  border-right: 2px solid var(--os-accent);
  border-radius: 0;
  box-shadow: none;
  transform: none;
  padding: 2px 12px 2px 0;
  text-align: right;
}

.offline-session-page .offline-beat--opening span,
.offline-session-page .offline-beat--directive span {
  color: var(--os-ink-3);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.offline-session-page .offline-beat--opening p,
.offline-session-page .offline-beat--directive p,
.offline-session-page .os-beat-multiline {
  color: var(--os-ink-2);
  font-size: calc(var(--os-body-size) - 2px);
  line-height: 1.7;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.offline-session-page .offline-beat--opening p {
  color: var(--os-ink);
}

/* 手机插曲 / 日界标：细线收敛 */
.offline-session-page .offline-beat--interlude {
  background: none;
  border: 1px dashed var(--os-line);
  border-radius: 10px;
}

.offline-session-page .offline-beat--daymark span {
  color: var(--os-ink-2);
  background: none;
  border: 1px solid var(--os-line);
}

/* beat 操作行：常驻但安静 */
.offline-session-page .offline-beat-actions {
  margin-top: 4px;
  padding-top: 0;
}

.offline-session-page .offline-beat--opening .offline-beat-actions,
.offline-session-page .offline-beat--directive .offline-beat-actions {
  justify-content: flex-end;
}

/* 翻译入口沿用锚点色 */
.offline-session-page .narration-translation {
  background: var(--os-accent-soft);
}

/* 底栏与工具：纸面 + 细线 */
.offline-session-page .offline-bar {
  background: var(--os-paper);
  border-top: 1px solid var(--os-line);
}

.offline-session-page .offline-plus {
  background: transparent;
  border-color: var(--os-line);
  color: var(--os-ink-2);
}

.offline-session-page .offline-directive {
  background: var(--surface);
  border-color: var(--os-line);
  color: var(--os-ink);
}

.offline-session-page .offline-tools {
  background: var(--os-paper);
  border-top-color: var(--os-line);
}

.offline-session-page .offline-tool {
  background: var(--surface);
}

.offline-session-page .offline-tool .offline-tool-state {
  background: var(--os-accent-soft);
  color: var(--os-accent);
}

.offline-session-page .offline-options {
  background: var(--os-paper);
}

.offline-session-page .offline-option-chip {
  background: var(--surface);
}

.offline-session-page .offline-option-chip b {
  background: var(--os-accent-soft);
  color: var(--os-accent);
}

/* 叙事设置：固定在真实视口底部，不再受页面底图层/滚动容器定位影响。 */
.offline-session-page .offline-settings-sheet {
  position: fixed !important;
  inset: 0 !important;
  z-index: 120;
  align-items: flex-end;
  padding-top: max(12px, var(--safe-top, 0px));
  font-family: var(--os-sans);
}

.offline-session-page .offline-settings-sheet-backdrop {
  background: rgba(13, 14, 17, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.offline-session-page .offline-settings-sheet-panel {
  width: min(100%, 560px);
  max-height: calc(100dvh - max(12px, var(--safe-top, 0px)));
  min-height: 0;
  border-radius: 20px 20px 0 0;
  background: var(--os-paper);
  box-shadow: 0 -20px 60px rgba(15, 16, 18, 0.18);
  overflow: hidden;
}

.offline-session-page .offline-settings-sheet-head {
  flex: 0 0 auto;
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--os-line);
  background: var(--os-paper);
}

.offline-session-page .offline-settings-sheet-head h2 {
  font-family: var(--os-sans);
  font-size: 16px;
  letter-spacing: 0;
}

.offline-session-page .offline-settings-sheet-head p {
  margin: 2px 0 0;
  color: var(--os-ink-3);
  font-size: 11px;
}

.offline-session-page .offline-settings-sheet-body {
  min-height: 0;
  padding: 10px 14px 18px;
  background: var(--os-paper);
  overscroll-behavior: contain;
}

.offline-session-page .offline-settings-sheet-foot {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 10px 14px calc(10px + var(--safe-bottom, 0px));
  border-top: 1px solid var(--os-line);
  background: var(--os-paper);
  box-shadow: 0 -8px 20px color-mix(in srgb, var(--os-paper) 86%, transparent);
}

.offline-session-page .offline-settings-sheet-foot .btn {
  min-height: 42px;
  border-radius: 12px;
}

.os-settings-preset {
  padding: 2px 0 10px;
}

.offline-session-page .os-settings-preset .off-preset-bar {
  gap: 6px;
}

.offline-session-page .os-settings-preset .off-preset-save,
.offline-session-page .os-settings-preset .off-preset-delete {
  padding-inline: 10px;
  white-space: nowrap;
}

.os-settings-group {
  border-top: 1px solid var(--os-line);
}

.os-settings-group:last-child {
  border-bottom: 1px solid var(--os-line);
}

.os-settings-group > summary {
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--os-ink);
}

.os-settings-group > summary::-webkit-details-marker {
  display: none;
}

.os-settings-group > summary span {
  font-size: 14px;
  font-weight: 600;
}

.os-settings-group > summary small {
  color: var(--os-ink-3);
  font-size: 11px;
  font-weight: 400;
}

.os-settings-group > summary .svg-icon {
  width: 16px;
  height: 16px;
  color: var(--os-ink-3);
  transition: transform 160ms ease;
}

.os-settings-group[open] > summary .svg-icon {
  transform: rotate(180deg);
}

.os-settings-group-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 0 16px;
}

.offline-session-page .os-settings-group-body .api-field,
.offline-session-page .os-settings-group-body .off-num-row,
.offline-session-page .os-settings-group-body .off-toggle-row {
  margin: 0;
}

.offline-session-page .os-settings-group-body .off-settings-divider {
  display: none;
}

/* 自动回复独立成一个短面板，不再埋进叙事参数。 */
.offline-session-page .os-auto-reply-sheet .offline-settings-sheet-panel {
  max-height: min(72dvh, 620px);
}

.offline-session-page .os-guided-revision-sheet .offline-settings-sheet-panel {
  max-height: min(82dvh, 680px);
}

.offline-session-page .os-routes-sheet .offline-settings-sheet-panel {
  max-height: min(82dvh, 680px);
}

.os-route-group + .os-route-group {
  margin-top: 18px;
}

.os-route-group h3 {
  margin: 0 0 7px;
  color: var(--os-ink-3, var(--text-hint));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.os-route-list,
.os-bookmark-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border-block: 1px solid var(--os-line, var(--border-soft));
}

.os-route-row,
.os-bookmark-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 54px;
  border-bottom: 1px solid var(--os-line, var(--border-soft));
}

.os-route-row:last-child,
.os-bookmark-row:last-child {
  border-bottom: 0;
}

.os-route-row.is-active {
  box-shadow: inset 2px 0 var(--os-accent, var(--accent));
}

.os-route-main,
.os-bookmark-row > button:first-child {
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--os-ink, var(--text));
  text-align: left;
}

.os-route-main strong,
.os-route-main small,
.os-bookmark-row strong,
.os-bookmark-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-route-main strong,
.os-bookmark-row strong {
  font-size: 13px;
  font-weight: 600;
}

.os-route-main small,
.os-bookmark-row small {
  margin-top: 2px;
  color: var(--os-ink-3, var(--text-hint));
  font-size: 10px;
}

.os-route-main:disabled {
  opacity: 1;
}

.os-route-icon-btn {
  min-height: 34px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--os-ink-2, var(--text-secondary));
  font-size: 11px;
}

.os-route-icon-btn.is-danger {
  color: #a34f4f;
}

.os-route-empty {
  padding: 18px 12px;
  color: var(--os-ink-3, var(--text-hint));
  font-size: 12px;
  text-align: center;
}

.os-route-main:focus-visible,
.os-bookmark-row > button:focus-visible,
.os-route-icon-btn:focus-visible {
  outline: 2px solid var(--os-accent, var(--accent));
  outline-offset: -2px;
}

.oda-unused-branches {
  margin-top: 14px;
  border-block: 1px solid var(--border-soft);
}

.oda-unused-branches > summary,
.oda-unused-branch > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.oda-unused-branches > summary span {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-card);
  text-align: center;
}

.oda-unused-branch {
  border-top: 1px solid var(--border-soft);
}

.oda-unused-branch > summary {
  min-height: 42px;
  padding-inline: 4px;
}

.oda-unused-rounds {
  display: grid;
  gap: 8px;
  padding: 0 0 12px;
}

@media (max-width: 420px) {
  .os-route-row,
  .os-bookmark-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .os-route-row .os-route-icon-btn:last-child,
  .os-bookmark-row .os-route-icon-btn:last-child {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .offline-session-page .offline-beat {
    scroll-behavior: auto;
  }
}

.os-revision-original {
  border-block: 1px solid var(--os-line);
}

.os-revision-original > summary,
.os-revision-history > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--os-ink-2);
  font-size: 12px;
  cursor: pointer;
}

.os-revision-original > p {
  max-height: 132px;
  margin: 0 0 12px;
  overflow: auto;
  color: var(--os-ink-3);
  font-family: var(--os-serif);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.os-revision-request {
  margin: 14px 0 10px;
}

.os-revision-request textarea {
  resize: vertical;
}

.os-revision-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.os-revision-chips button,
.os-revision-restore {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--os-line);
  border-radius: 999px;
  background: transparent;
  color: var(--os-ink-2);
  font-family: var(--os-sans);
  font-size: 11px;
  cursor: pointer;
}

.os-revision-chips button.is-active {
  border-color: var(--os-accent);
  background: var(--os-accent-soft);
  color: var(--os-accent);
}

.os-revision-status {
  min-height: 18px;
  margin-top: 8px;
  color: var(--os-ink-3);
  font-size: 11px;
}

.os-revision-history {
  margin-top: 4px;
  border-top: 1px solid var(--os-line);
}

.os-revision-history > summary span {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--os-accent-soft);
  color: var(--os-accent);
  text-align: center;
}

.os-revision-history-list {
  display: grid;
  gap: 8px;
  padding-bottom: 4px;
}

.os-revision-version {
  padding: 9px 10px;
  border: 1px solid var(--os-line);
  border-radius: 12px;
  background: var(--os-surface);
}

.os-revision-version > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--os-ink-3);
  font-size: 10px;
}

.os-revision-version > header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-revision-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0;
}

.os-revision-compare details {
  min-width: 0;
  color: var(--os-ink-2);
  font-size: 11px;
}

.os-revision-compare p {
  max-height: 92px;
  margin: 5px 0 0;
  overflow: auto;
  color: var(--os-ink-3);
  font-family: var(--os-serif);
  line-height: 1.55;
  white-space: pre-wrap;
}

.os-revision-restore {
  min-height: 28px;
  padding-block: 4px;
}

.offline-session-page .os-auto-reply-sheet [hidden] {
  display: none !important;
}

.os-reply-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}

.os-reply-mode {
  min-width: 0;
  min-height: 72px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  border: 1px solid var(--os-line);
  border-radius: 12px;
  background: transparent;
  color: var(--os-ink);
  text-align: left;
  cursor: pointer;
}

.os-reply-mode strong {
  font-size: 13px;
}

.os-reply-mode small {
  color: var(--os-ink-3);
  font-size: 10px;
  line-height: 1.45;
}

.os-reply-mode.is-active {
  border-color: var(--os-accent);
  background: var(--os-accent-soft);
}

.os-phone-playback-settings {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
  border-top: 1px solid var(--os-line);
}

.os-phone-playback-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 62px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--os-line);
}

.os-phone-playback-row.is-toggle-only {
  grid-template-columns: minmax(0, 1fr) auto;
}

.os-phone-playback-row > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.os-phone-playback-row strong {
  color: var(--os-ink);
  font-size: 13px;
}

.os-phone-playback-row small {
  color: var(--os-ink-3);
  font-size: 10px;
  line-height: 1.4;
}

.os-phone-playback-row .form-input {
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.offline-session-page .off-auto-reply-global {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--os-ink-2);
  font-size: 12px;
}

.offline-session-page .offline-settings-sheet .form-input {
  border-color: var(--os-line);
  background: var(--os-surface);
  color: var(--os-ink);
  box-shadow: none;
}

.offline-session-page .offline-settings-sheet .off-seg-btn {
  border-color: var(--os-line);
  background: transparent;
  color: var(--os-ink-2);
}

.offline-session-page .offline-settings-sheet .off-seg-btn.is-active {
  border-color: var(--os-accent);
  background: var(--os-accent-soft);
  color: var(--os-accent);
  box-shadow: none;
}

.offline-session-page .offline-settings-sheet input[type="checkbox"] {
  accent-color: var(--os-accent);
}

/* 底部输入：单一胶囊输入 + 两枚克制图标按钮。 */
.offline-session-page .offline-bar {
  gap: 7px;
  padding: 8px 12px calc(8px + var(--safe-bottom));
}

.offline-session-page .offline-bar .offline-plus {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
}

.offline-session-page .offline-bar .offline-input-wrap {
  min-height: 38px;
  border: 1px solid var(--os-line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.offline-session-page .offline-bar .offline-directive {
  min-height: 38px;
  height: auto;
  padding: 8px 34px 8px 12px;
  border: none;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
  font-family: var(--os-sans);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  resize: none;
}

.offline-session-page .offline-bar .offline-directive:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--os-accent);
}

.offline-session-page .offline-bar .offline-expand {
  right: 3px;
  bottom: 4px;
  top: auto;
  transform: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--os-ink-3);
}

.offline-session-page .offline-bar .offline-advance {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 13px;
  box-shadow: none;
}

/* 每段文字的翻页页脚：默认只显示时间和省略号，操作按需展开。 */
.os-beat-footer {
  position: relative;
  min-height: 28px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--os-ink-3);
}

.os-beat-rule {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--os-line));
}

.os-beat-thoughts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: min(58%, 320px);
  overflow-x: auto;
  scrollbar-width: none;
}

.os-beat-thoughts::-webkit-scrollbar {
  display: none;
}

.os-beat-thought {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--os-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--os-accent-soft) 52%, transparent);
  color: var(--os-ink-2);
  font-family: var(--os-sans);
  font-size: 10px;
  line-height: 1.2;
  cursor: pointer;
}

.os-beat-thought:hover,
.os-beat-thought:focus-visible {
  border-color: var(--os-accent);
  color: var(--os-accent);
  outline: none;
}

.os-beat-footer time {
  font-family: var(--os-sans);
  font-size: 10px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.os-beat-menu {
  width: 28px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--os-ink-3);
  cursor: pointer;
}

.os-beat-menu .svg-icon {
  width: 16px;
  height: 16px;
}

.os-beat-menu--floor {
  min-width: 28px;
  padding: 0 6px;
  font-family: var(--os-sans);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--os-ink-2);
}

.os-beat-floor {
  line-height: 1;
}

.os-beat-menu[aria-expanded="true"] {
  background: var(--os-accent-soft);
  color: var(--os-accent);
}

.os-beat-footer .offline-beat-actions {
  margin: 0;
  padding: 0 2px 0 4px;
  gap: 2px;
}

.os-beat-footer .offline-beat-actions[hidden] {
  display: none;
}

.os-beat-footer .offline-beat-edit,
.os-beat-footer .offline-beat-delete,
.os-beat-footer .offline-beat-image-btn,
.os-beat-footer .offline-beat-revise {
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--os-ink-2);
  font-family: var(--os-sans);
  font-size: 11px;
  padding: 5px 7px;
  cursor: pointer;
}

.os-beat-footer .offline-beat-delete {
  color: #a95b58;
}

/* 手机往来只占一张消息提醒，不把聊天摘要铺进叙事正文。 */
.offline-session-page .offline-beat--interlude.os-interlude-notice {
  max-width: 100%;
  padding: 0;
  border: none;
  background: transparent;
}

.os-message-notice {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--os-line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--os-paper) 92%, transparent);
  color: var(--os-ink);
  text-align: left;
  cursor: pointer;
}

.offline-session-page .os-phone-action-notices {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.offline-session-page .os-phone-action-notices .os-message-notice {
  background: color-mix(in srgb, var(--os-paper) 86%, var(--os-accent-soft));
}

.offline-session-page .os-message-notice:focus-visible {
  outline: 2px solid var(--os-accent);
  outline-offset: 2px;
}

.os-message-notice-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--os-accent-soft);
  color: var(--os-accent);
}

.os-message-notice-icon .svg-icon,
.os-message-notice-go .svg-icon {
  width: 16px;
  height: 16px;
}

.os-message-notice-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.os-message-notice-copy strong {
  overflow: hidden;
  color: var(--os-ink);
  font-family: var(--os-sans);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-message-notice-copy small {
  overflow: hidden;
  color: var(--os-ink-3);
  font-family: var(--os-sans);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-message-notice-go {
  color: var(--os-ink-3);
}

.os-phone-cinematic-cue {
  position: fixed;
  z-index: 180;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 190px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(18, 19, 22, 0.9);
  color: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  font-family: var(--os-sans);
  font-size: 13px;
  animation: osPhoneCueIn 220ms ease-out both;
}

.os-phone-cinematic-cue .svg-icon {
  width: 18px;
  height: 18px;
}

@keyframes osPhoneCueIn {
  from { opacity: 0; transform: translate(-50%, -44%) scale(0.96); }
}

.oda-round--message-notice {
  width: 100%;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text);
  text-align: left;
}

.oda-round--message-notice > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.oda-round--message-notice strong,
.oda-round--message-notice small {
  display: block;
}

.oda-round--message-notice small {
  color: var(--text-hint);
  font-size: 11px;
}

.oda-message-notice-icon {
  color: var(--text-accent);
}

@media (prefers-reduced-motion: reduce) {
  .os-phone-cinematic-cue {
    animation: none;
  }

  .offline-options-pending i {
    animation: none;
    opacity: 0.55;
  }
}

/* ============ beat 重 roll（最后一轮叙事常驻） ============ */
.offline-beat-reroll {
  border: none;
  background: transparent;
  color: var(--text-hint);
  font-size: var(--font-xs);
  padding: 4px 10px;
  cursor: pointer;
}

.offline-beat-reroll:active {
  color: var(--text-accent);
}

.offline-beat-edit:focus-visible,
.offline-beat-delete:focus-visible,
.offline-beat-reroll:focus-visible,
.offline-beat-revise:focus-visible,
.os-revision-chips button:focus-visible,
.os-revision-restore:focus-visible,
.os-revision-original > summary:focus-visible,
.os-revision-history > summary:focus-visible,
.os-history-toggle:focus-visible,
.os-manage-btn:focus-visible {
  outline: 2px solid var(--accent, #e2895f);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (max-width: 430px) {
  .os-revision-compare {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .os-guided-revision-sheet *,
  .os-guided-revision-sheet *::before,
  .os-guided-revision-sheet *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============ 管理模式：批量选择 / 删除（两套皮通用） ============ */
.os-manage-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: var(--bg-sheet);
  border-top: 1px solid var(--border);
}

.os-manage-bar[hidden] {
  display: none;
}

.os-manage-count {
  flex: 1;
  min-width: 0;
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.os-manage-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border-soft, #ece0d6);
  background: var(--surface, #fff);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: var(--font-sm);
  color: var(--text);
  cursor: pointer;
}

.os-manage-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.os-manage-btn--danger {
  color: #b8433a;
  border-color: rgba(184, 67, 58, 0.4);
}

.offline-beats.is-managing .offline-beat:not(.offline-beat--daymark) {
  position: relative;
  margin-left: 30px;
}

.os-beat-pick {
  position: absolute;
  top: 6px;
  left: -30px;
  display: inline-flex;
  padding: 2px;
}

.os-beat-pick input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #e2895f);
}

/* 历史折叠：早前剧情收起，一键展开 */
.os-history-toggle {
  display: block;
  margin: 0 auto 14px;
  border: 1px solid var(--border-soft, #ece0d6);
  background: var(--surface, #fff);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  cursor: pointer;
}

/* ============ 美化界面 · token 偏好面板 ============
   面板挂在全局 modal 容器（页面作用域之外），单独按相遇皮 token 换装：
   纯白面、发丝线、石墨 #17181b 强调，黑体栈。 */
.os-style-sheet {
  width: min(560px, 100%);
  margin-left: auto;
  margin-right: auto;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: #ffffff;
  background-image: none;
  border: 1px solid rgba(26, 27, 30, 0.08);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(15, 16, 18, 0.16);
}

.os-style-sheet .modal-header h3 {
  font-family: inherit;
  color: #1a1b1e;
}

.os-style-sheet .os-style-label {
  color: #72737a;
}

.os-style-sheet .os-style-val {
  color: rgba(26, 27, 30, 0.4);
}

.os-style-sheet .os-style-seg-btn {
  background: #ffffff;
  border-color: rgba(26, 27, 30, 0.12);
  color: #72737a;
}

.os-style-sheet .os-style-seg-btn.is-on {
  border-color: #17181b;
  color: #17181b;
}

.os-style-sheet .os-style-range,
.os-style-sheet input[type="checkbox"] {
  accent-color: #17181b;
}

.os-style-sheet .form-input {
  background: #ffffff;
  border-color: rgba(26, 27, 30, 0.12);
  color: #1a1b1e;
}

.os-style-sheet .btn-primary {
  background: #17181b;
  border-color: #17181b;
  color: #ffffff;
  box-shadow: none;
}

.os-style-sheet .btn-outline {
  background: transparent;
  border: 1px solid rgba(26, 27, 30, 0.14);
  color: #72737a;
  box-shadow: none;
}

.os-style-sheet .os-style-foot {
  border-top-color: rgba(26, 27, 30, 0.08);
}

.os-style-sheet .os-style-row--check {
  color: #72737a;
}

.os-style-sheet .modal-close-btn {
  background: transparent;
  color: #72737a;
  box-shadow: none;
}

.os-style-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.os-style-presets {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(26, 27, 30, 0.08);
}

.os-style-preset-row,
.os-style-preset-save-row,
.os-style-doc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.os-style-preset-select,
.os-style-preset-save-row .form-input {
  min-width: 0;
  flex: 1;
}

.os-style-doc-actions {
  flex-wrap: wrap;
  margin-top: -6px;
}

.os-style-sheet :is(button, input, select, textarea):focus-visible {
  outline: 2px solid rgba(23, 24, 27, 0.58);
  outline-offset: 2px;
}

.os-style-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.os-style-row--check {
  flex-direction: row;
  align-items: center;
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

.os-style-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

.os-style-val {
  font-style: normal;
  font-weight: 400;
  color: var(--text-hint);
}

.os-style-seg {
  display: flex;
  gap: 6px;
}

.os-style-seg-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--border-soft, #ece0d6);
  border-radius: 10px;
  background: var(--surface, #fff);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.os-style-seg-btn.is-on {
  border-color: var(--accent, #e2895f);
  color: var(--accent, #e2895f);
  font-weight: 600;
}

.os-style-range {
  width: 100%;
  accent-color: var(--accent, #e2895f);
}

.os-style-css {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

.os-style-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

@media (max-width: 440px) {
  .os-style-preset-row,
  .os-style-preset-save-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .os-style-preset-row .os-style-preset-select,
  .os-style-preset-save-row .form-input {
    flex-basis: 100%;
  }
}

/* ============ 我们的记录 · 一起旅行徽标 ============ */
.odl-item-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 1px 8px;
  margin-top: 1px;
  font-size: 10px;
  font-weight: 700;
  color: #4f7d70;
  background: rgba(120, 160, 150, 0.16);
  border-radius: 999px;
}
