/* ========================================
   offline-mode.css - 线下模式页面样式
   沉浸式长文本对话界面
   所有类名加 offline- 前缀，避免污染其他页面
   ======================================== */

/* ======== 页面容器 ======== */
.offline-page {
  position: absolute;
  inset: 0;
  z-index: 7000;
  display: flex;
  flex-direction: column;
  background: var(--offline-bg, #f8f8fa);
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ======== 背景主题 ======== */
.offline-page[data-theme="default"] { --offline-bg: #f8f8fa; --offline-header-bg: rgba(255,255,255,0.88); --offline-card-bg: #fff; --offline-text-primary: #1a1a1a; --offline-text-secondary: #666; --offline-input-bg: #f5f5f7; --offline-border: rgba(0,0,0,0.06); }
.offline-page[data-theme="eyecare"] { --offline-bg: #f5f0e8; --offline-header-bg: rgba(245,240,232,0.92); --offline-card-bg: #fdfaf5; --offline-text-primary: #2c2416; --offline-text-secondary: #6b5d4d; --offline-input-bg: #efe9df; --offline-border: rgba(107,93,77,0.1); }
.offline-page[data-theme="dark"] { --offline-bg: #1c1c1e; --offline-header-bg: rgba(28,28,30,0.92); --offline-card-bg: #2c2c2e; --offline-text-primary: #e5e5e7; --offline-text-secondary: #a1a1a6; --offline-input-bg: #3a3a3c; --offline-border: rgba(255,255,255,0.08); }
.offline-page[data-theme="blue"] { --offline-bg: #eef3fa; --offline-header-bg: rgba(238,243,250,0.92); --offline-card-bg: #f8fbff; --offline-text-primary: #1a2a3a; --offline-text-secondary: #5a7a9a; --offline-input-bg: #e4ecf5; --offline-border: rgba(74,120,180,0.08); }
.offline-page[data-theme="pink"] { --offline-bg: #faf0f3; --offline-header-bg: rgba(250,240,243,0.92); --offline-card-bg: #fff8fa; --offline-text-primary: #3a1a24; --offline-text-secondary: #9a6a7a; --offline-input-bg: #f5e8ec; --offline-border: rgba(180,74,100,0.08); }

.offline-page.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* ======== 顶部栏 ======== */
.offline-header {
  position: relative;
  z-index: 7010;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--offline-header-bg, rgba(255, 255, 255, 0.88));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 0.5px solid var(--offline-border, rgba(0, 0, 0, 0.06));
  flex-shrink: 0;
}

.offline-header__back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--offline-text-primary, #333);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
}

.offline-header__back:active {
  background: rgba(0, 0, 0, 0.05);
}

.offline-header__back svg {
  width: 20px;
  height: 20px;
}

.offline-header__center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  min-width: 0;
}

.offline-header__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #eee;
}

.offline-header__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.offline-header__info {
  min-width: 0;
}

.offline-header__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--offline-text-primary, #1a1a1a);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offline-header__status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #999;
  line-height: 1.3;
}

.offline-header__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4cd964;
  flex-shrink: 0;
}

.offline-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.offline-header__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--offline-text-secondary, #666);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}

.offline-header__btn:active {
  background: rgba(0, 0, 0, 0.05);
}

.offline-header__btn svg {
  width: 18px;
  height: 18px;
}

/* ======== 主内容滚动区 ======== */
.offline-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  -webkit-overflow-scrolling: touch;
}

/* ======== 场景信息卡片 ======== */
.offline-scene-card {
  background: var(--offline-card-bg, #fff);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border: 0.5px solid var(--offline-border, rgba(0, 0, 0, 0.05));
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.offline-scene-card__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.offline-scene-card__icon {
  width: 14px;
  height: 14px;
  color: #999;
}

.offline-scene-card__label {
  font-size: 11px;
  color: #999;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.offline-scene-card__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--offline-text-primary, #1a1a1a);
  margin-bottom: 8px;
  line-height: 1.4;
}

.offline-scene-card__desc {
  font-size: 13px;
  color: var(--offline-text-secondary, #666);
  line-height: 1.6;
  margin-bottom: 12px;
}

.offline-scene-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offline-scene-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #888;
  background: #f5f5f7;
  padding: 4px 10px;
  border-radius: 20px;
}

.offline-scene-card__tag svg {
  flex-shrink: 0;
  color: #aaa;
}

/* ======== 长文本对话区 ======== */
.offline-story-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 通用故事块 */
.offline-story-block {
  max-width: 100%;
}

/* ---- 系统提示 ---- */
.offline-story-block--system {
  display: flex;
  justify-content: center;
}

.offline-story-system {
  font-size: 12px;
  color: #aaa;
  background: rgba(0, 0, 0, 0.03);
  padding: 6px 14px;
  border-radius: 20px;
  text-align: center;
  line-height: 1.5;
}

/* ---- 场景变化提示 ---- */
.offline-story-block--scene-change {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.offline-story-scene-change {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #999;
  font-style: italic;
  text-align: center;
  line-height: 1.5;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  border-left: 2px solid rgba(0, 0, 0, 0.08);
}

.offline-story-scene-change svg {
  flex-shrink: 0;
  color: #bbb;
}

/* ---- 说话人标识 ---- */
.offline-story-speaker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.offline-story-speaker__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #eee;
}

.offline-story-speaker__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.offline-story-speaker__name {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.3px;
}

/* ---- 用户段落样式 ---- */
.offline-story-block--user .offline-story-speaker__name {
  color: #666;
}

.offline-story-block--user .offline-story-content {
  background: var(--offline-card-bg, #fff);
  border-radius: 18px;
  padding: 14px 18px;
  border: 0.5px solid var(--offline-border, rgba(0, 0, 0, 0.04));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

/* ---- 角色段落样式 ---- */
.offline-story-block--character .offline-story-speaker__name {
  color: #555;
}

.offline-story-block--character .offline-story-content {
  background: var(--offline-card-bg, #fff);
  border-radius: 18px;
  padding: 14px 18px;
  border: 0.5px solid var(--offline-border, rgba(0, 0, 0, 0.04));
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
  border-left: 3px solid var(--offline-border, rgba(0, 0, 0, 0.06));
}

/* ---- 文本内容排版 ---- */
.offline-story-content {
  font-size: 15px;
  color: var(--offline-text-primary, #222);
  line-height: 1.65;
  word-break: break-word;
}

.offline-story-content p {
  margin: 0;
  padding: 0;
}

.offline-story-content p + p {
  margin-top: 12px;
}

/* ======== 底部快捷操作区 ======== */
.offline-quick-actions {
  position: relative;
  z-index: 7010;
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--offline-card-bg, #fff);
  border-top: 0.5px solid var(--offline-border, rgba(0, 0, 0, 0.05));
}

.offline-quick-actions__scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.offline-quick-actions__scroll::-webkit-scrollbar {
  display: none;
}

.offline-quick-actions__btn {
  flex-shrink: 0;
  font-size: 12px;
  color: #555;
  background: #f5f5f7;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.offline-quick-actions__btn:active {
  background: #eaeaec;
  color: #333;
}

/* ======== 底部输入区 ======== */
.offline-input-area {
  position: relative;
  z-index: 7010;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--offline-card-bg, #fff);
  box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.04);
}

.offline-input-area__field-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.offline-input-area__field {
  width: 100%;
  min-height: 36px;
  max-height: 36px;
  padding: 8px 36px 8px 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--offline-text-primary, #222);
  background: var(--offline-input-bg, #f5f5f7);
  border: 0.5px solid var(--offline-border, rgba(0, 0, 0, 0.06));
  border-radius: 20px;
  resize: none;
  outline: none;
  transition: min-height 0.25s ease, max-height 0.25s ease, border-color 0.2s, background 0.2s, border-radius 0.25s;
  font-family: inherit;
  overflow: hidden;
}

.offline-input-area__field:focus {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.12);
}

.offline-input-area__field::placeholder {
  color: #bbb;
}

/* 展开状态 */
.offline-input-area--expanded {
  align-items: flex-end;
}

.offline-input-area--expanded .offline-input-area__field {
  min-height: 100px;
  max-height: 160px;
  border-radius: 14px;
  padding: 10px 36px 10px 14px;
  overflow-y: auto;
}

/* 展开按钮 */
.offline-input-area__expand {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #aaa;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s, transform 0.2s;
}

.offline-input-area__expand:active {
  color: #555;
}

.offline-input-area__expand svg {
  width: 14px;
  height: 14px;
}

.offline-input-area--expanded .offline-input-area__expand {
  top: auto;
  bottom: 8px;
  transform: rotate(45deg);
}

.offline-input-area__actions {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4px;
}

.offline-input-area__send {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #1a1a1a;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}

.offline-input-area__send:active {
  transform: scale(0.92);
  opacity: 0.85;
}

.offline-input-area__send svg {
  width: 18px;
}

/* ── 生成回复按钮（复用线上 AI 按钮风格） ── */
.offline-input-area__ai {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary, #f0f0f0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
  color: transparent;
  margin-left: 6px;
}
.offline-input-area__ai:active {
  transform: scale(0.88);
}
.offline-input-area__ai .chat-ai-icon {
  width: 20px;
  height: 20px;
}
.offline-input-area__ai .chat-ai-icon--stop {
  display: none;
}
.offline-input-area__ai--loading .chat-ai-icon--normal {
  display: none;
}
.offline-input-area__ai--loading .chat-ai-icon--stop {
  display: block;
  height: 18px;
}

/* ---- 收藏按钮（角色消息块底部） ---- */
.offline-story-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 8px;
  margin-top: 4px;
}

.offline-story-actions__fav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  background: none;
  color: #bbb;
  font-size: 11px;
  cursor: pointer;
  border-radius: 14px;
  transition: color 0.2s, background 0.2s;
}

.offline-story-actions__fav:active {
  color: #e74c6f;
  background: rgba(231, 76, 111, 0.06);
}

.offline-story-actions__fav svg {
  width: 14px;
  height: 14px;
}

/* ---- 结束并总结按钮样式 ---- */
.offline-quick-actions__btn--end {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #e74c6f;
  border-color: rgba(231, 76, 111, 0.15);
  background: rgba(231, 76, 111, 0.04);
}

.offline-quick-actions__btn--end:active {
  background: rgba(231, 76, 111, 0.1);
  color: #d43d5e;
}

/* ---- 直接退出按钮样式 ---- */
.offline-quick-actions__btn--quick-exit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #888;
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.offline-quick-actions__btn--quick-exit:active {
  background: rgba(0, 0, 0, 0.06);
  color: #555;
}

/* ========================================
   线下模式入口弹窗（底部抽屉）
   类名前缀：offline-entry-
   ======================================== */

/* ---- 弹窗容器 ---- */
.offline-entry-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.offline-entry-modal.is-active {
  pointer-events: auto;
  opacity: 1;
}

/* ---- 遮罩 ---- */
.offline-entry-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.offline-entry-modal.is-active .offline-entry-backdrop {
  opacity: 1;
}

/* ---- 抽屉主体 ---- */
.offline-entry-drawer {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

.offline-entry-modal.is-active .offline-entry-drawer {
  transform: translateY(0);
}

/* ---- 拖拽手柄 ---- */
.offline-entry-handle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 14px;
  flex-shrink: 0;
}

/* ---- 头部 ---- */
.offline-entry-header {
  margin-bottom: 18px;
}

.offline-entry-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px;
  line-height: 1.3;
}

.offline-entry-subtitle {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
  margin: 0;
}

/* ---- 主体 ---- */
.offline-entry-body {
  flex: 1;
  min-height: 0;
}

.offline-entry-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

.offline-entry-label--mt {
  margin-top: 16px;
}

.offline-entry-hint {
  margin: 6px 0 10px;
  font-size: 12px;
  color: var(--text-quaternary, #999);
  line-height: 1.5;
}

.offline-entry-input--theme {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
}

.offline-entry-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-size: 15px;
  color: #222;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.offline-entry-input:focus {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.offline-entry-input::placeholder {
  color: #bbb;
  font-size: 14px;
}

.offline-entry-textarea {
  width: 100%;
  min-height: 100px;
  max-height: 160px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: #222;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  resize: none;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.offline-entry-textarea:focus {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.offline-entry-textarea::placeholder {
  color: #bbb;
  font-size: 13px;
  line-height: 1.5;
}

/* ---- 快捷场景 chips ---- */
.offline-entry-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.offline-entry-chip {
  display: inline-block;
  font-size: 12px;
  color: #555;
  background: #f0f0f2;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.offline-entry-chip:active {
  background: #e4e4e6;
  color: #333;
  transform: scale(0.95);
}

/* ---- 底部按钮区 ---- */
.offline-entry-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-shrink: 0;
}

.offline-entry-btn {
  flex: 1;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.offline-entry-btn:active {
  transform: scale(0.97);
}

.offline-entry-btn--cancel {
  background: #f0f0f2;
  color: #555;
}

.offline-entry-btn--cancel:active {
  background: #e4e4e6;
}

.offline-entry-btn--confirm {
  background: #1a1a1a;
  color: #fff;
}

.offline-entry-btn--confirm:active {
  opacity: 0.85;
}

/* ======== 双引号对话文本高亮 ======== */
.offline-dialogue {
  font-weight: 700;
  font-size: 1.08em;
  color: var(--offline-text-primary, #1a1a1a);
  letter-spacing: 0.2px;
}

/* ======== 长按上下文菜单 ======== */
.offline-context-menu {
  position: fixed;
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 2px;
  background: #fff;
  border-radius: 14px;
  padding: 6px 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: scale(0.85) translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.offline-context-menu.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.offline-context-menu__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 56px;
  height: 56px;
  border: none;
  background: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.offline-context-menu__btn:active {
  background: rgba(0, 0, 0, 0.05);
}

.offline-context-menu__btn svg {
  width: 20px;
  height: 20px;
  color: #333;
}

.offline-context-menu__btn span {
  font-size: 10px;
  color: #666;
  white-space: nowrap;
}

.offline-context-menu__btn--fav svg { color: #f5a623; }
.offline-context-menu__btn--delete svg { color: #e74c6f; }
.offline-context-menu__btn--select svg { color: #5b7fff; }
.offline-context-menu__btn--edit svg { color: #8e8e93; }
.offline-context-menu__btn--retry svg { color: #34c759; }

/* 上下文菜单遮罩 */
.offline-context-overlay {
  position: fixed;
  inset: 0;
  z-index: 99989;
  background: transparent;
}

/* ======== 多选模式 ======== */
.offline-page--multiselect .offline-story-block {
  position: relative;
  padding-left: 36px;
}

.offline-page--multiselect .offline-story-block::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
}

.offline-page--multiselect .offline-story-block--selected::before {
  border-color: #1a1a1a;
  background: #1a1a1a;
  box-shadow: inset 0 0 0 3px #fff;
}

.offline-page--multiselect .offline-story-block--system {
  padding-left: 0;
}

.offline-page--multiselect .offline-story-block--system::before {
  display: none;
}

/* 多选底部工具栏 */
.offline-multiselect-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 7020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.offline-multiselect-bar__cancel {
  font-size: 14px;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
}

.offline-multiselect-bar__cancel:active {
  background: rgba(0, 0, 0, 0.04);
}

.offline-multiselect-bar__delete {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #e74c6f;
  border: none;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 8px;
  transition: opacity 0.2s;
}

.offline-multiselect-bar__delete:active {
  opacity: 0.8;
}

/* ======== 长按收藏反馈 ======== */
.offline-story-block--faved {
  animation: offlineFavPulse 0.6s ease;
}
@keyframes offlineFavPulse {
  0% { box-shadow: none; }
  30% { box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.25); }
  100% { box-shadow: none; }
}

/* ======== 编辑面板 ======== */
.offline-edit-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 7030;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  padding: 16px 18px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}

.offline-edit-panel.is-active {
  transform: translateY(0);
  pointer-events: auto;
}

.offline-edit-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.offline-edit-panel__title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

.offline-edit-panel__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f0f0f2;
  border-radius: 50%;
  cursor: pointer;
  color: #666;
  transition: background 0.2s;
}

.offline-edit-panel__close:active {
  background: #e4e4e6;
}

.offline-edit-panel__close svg {
  width: 14px;
  height: 14px;
}

.offline-edit-panel__body {
  margin-bottom: 14px;
}

.offline-edit-panel__field {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: #222;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  resize: none;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
  overflow-y: auto;
}

.offline-edit-panel__field:focus {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.15);
}

.offline-edit-panel__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.offline-edit-panel__cancel {
  font-size: 14px;
  color: #666;
  background: #f0f0f2;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.2s;
}

.offline-edit-panel__cancel:active {
  background: #e4e4e6;
}

.offline-edit-panel__save {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #1a1a1a;
  border: none;
  border-radius: 8px;
  padding: 8px 22px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.offline-edit-panel__save:active {
  opacity: 0.8;
}

/* ======== Toast 提示 ======== */
.offline-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 20px;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}
.offline-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
