/* ===== 视图过渡动画（由 Router 按导航方向注入） ===== */
.view-enter-forward { animation: view-fwd 0.26s cubic-bezier(0.32, 0.72, 0, 1); }
.view-enter-back    { animation: view-back 0.26s cubic-bezier(0.32, 0.72, 0, 1); }
.view-enter-tab     { animation: view-tab 0.2s ease-out; }

@keyframes view-fwd {
  from { opacity: 0; transform: translate3d(18px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes view-back {
  from { opacity: 0; transform: translate3d(-18px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes view-tab {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

/* 列表项依次淡入（轻量交错） */
.stagger-in > * { animation: stagger 0.28s ease-out backwards; }
.stagger-in > *:nth-child(1)  { animation-delay: 0.00s; }
.stagger-in > *:nth-child(2)  { animation-delay: 0.03s; }
.stagger-in > *:nth-child(3)  { animation-delay: 0.06s; }
.stagger-in > *:nth-child(4)  { animation-delay: 0.09s; }
.stagger-in > *:nth-child(5)  { animation-delay: 0.12s; }
.stagger-in > *:nth-child(6)  { animation-delay: 0.15s; }
.stagger-in > *:nth-child(7)  { animation-delay: 0.18s; }
.stagger-in > *:nth-child(8)  { animation-delay: 0.21s; }
.stagger-in > *:nth-child(n+9){ animation-delay: 0.24s; }

@keyframes stagger {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* 模态关闭动画 */
.modal-overlay.closing { animation: fade-out 0.2s ease forwards; }
.modal-overlay.closing .modal-sheet { animation: slide-down 0.22s ease forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes slide-down { to { transform: translateY(100%); } }

/* 折叠展开动画 */
.collapse-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s cubic-bezier(0.32,0.72,0,1), opacity 0.2s ease;
}
.collapse-body.open { max-height: 1600px; opacity: 1; }

/* 尊重系统「减少动效」偏好 */
@media (prefers-reduced-motion: reduce) {
  .view-enter-forward, .view-enter-back, .view-enter-tab,
  .stagger-in > *, .modal-overlay, .modal-sheet { animation: none !important; }
  .collapse-body { transition: none; }
}

/* ===== 卡片 ===== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
}

.card:active {
  transform: scale(0.985);
}

.card.expandable { cursor: pointer; }
.card.expandable.expanded { box-shadow: var(--shadow-md); }
.card-expand-icon {
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}
.card.expandable.expanded .card-expand-icon { transform: rotate(90deg); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:active {
  opacity: 0.8;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
}

.btn-ghost:active {
  background: var(--color-primary-light);
}

.btn-danger {
  background: transparent;
  color: var(--color-danger);
}

.btn-danger:active {
  background: rgba(255,59,48,0.1);
}

.btn-sm {
  padding: 6px 14px;
  font-size: var(--font-size-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ===== 列表项 ===== */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.list-item:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.list-item:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border-bottom: none;
}

.list-item:only-child {
  border-radius: var(--radius-md);
}

.list-item:active {
  background: var(--color-surface-hover);
}

.list-item-body {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: var(--font-size-base);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 底栏 ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* 56px 内容区 + 底部安全区；显式 border-box，
     即使全局重置未生效也保证内容区恒为 56px（否则会再叠一次安全区导致过高） */
  box-sizing: border-box;
  height: var(--tab-bar-total);
  padding-bottom: var(--safe-area-bottom);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tab-item.active {
  color: var(--color-primary);
}

.tab-item svg {
  width: 24px;
  height: 24px;
}

.tab-item span {
  font-size: 10px;
  font-weight: 500;
}

/* ===== Tab 顺序设置页（拖拽排序列表） ===== */
.tab-order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 32px;
}
.tab-order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.tab-order-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-surface-hover);
  color: var(--color-text-secondary);
  flex: none;
}
.tab-order-label {
  flex: 1;
  font-weight: 600;
  font-size: var(--font-size-base);
}
.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-text-tertiary);
  cursor: grab;
  flex: none;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.tab-order-item.is-dragging {
  position: fixed;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border-color: var(--color-primary);
  opacity: 0.95;
  pointer-events: none;
}
.tab-order-placeholder {
  background: var(--color-surface-hover);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2s forwards;
  white-space: nowrap;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* ===== 模态 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.2s ease;
}

.modal-sheet {
  width: 100%;
  max-height: 85vh;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 16px calc(20px + var(--safe-area-bottom));
  overflow-y: auto;
  animation: slide-up 0.3s ease;
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ===== 标签 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.tag-sm {
  padding: 1px 6px;
  font-size: 10px;
}

/* ===== 徽标 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: var(--color-danger);
  color: #fff;
}

/* ===== 复选框 ===== */
.checkbox-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.checkbox-circle.checked {
  background: var(--color-success);
  border-color: var(--color-success);
}

.checkbox-circle svg {
  width: 12px;
  height: 12px;
  color: #fff;
}

/* ===== 面板切换 ===== */
.segmented-control {
  display: flex;
  background: var(--color-surface-hover);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.segmented-item {
  flex: 1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-align: center;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.segmented-item.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* ===== 输入组 ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row > * {
  flex: 1;
}

/* ===== 进度环 ===== */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 4;
}

.progress-ring .bg {
  stroke: var(--color-border-light);
}

.progress-ring .fg {
  stroke: var(--color-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-text {
  position: absolute;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

/* ===== 分割线 ===== */
.divider {
  height: 1px;
  background: var(--color-border-light);
  margin: 12px 0;
}

/* ===== 标签（选中态） ===== */
.tag-active {
  background: var(--color-primary);
  color: #fff;
}

/* ===== Markdown 渲染 ===== */
.markdown-body {
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  line-height: 1.7;
  word-wrap: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 16px 0 8px;
  line-height: 1.3;
  font-weight: 700;
}

.markdown-body h1 { font-size: var(--font-size-xl); }
.markdown-body h2 { font-size: var(--font-size-lg); }
.markdown-body h3 { font-size: var(--font-size-md); }
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 { font-size: var(--font-size-base); }

.markdown-body > *:first-child { margin-top: 0; }

.markdown-body p { margin: 8px 0; }

.markdown-body ul,
.markdown-body ol {
  margin: 8px 0;
  padding-left: 22px;
}

.markdown-body ul { list-style: disc; }
.markdown-body ol { list-style: decimal; }
.markdown-body li { margin: 4px 0; }

.markdown-body blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--color-primary);
  background: var(--color-surface-hover);
  color: var(--color-text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface-hover);
  padding: 2px 6px;
  border-radius: 4px;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 16px 0;
}

.markdown-body a {
  color: var(--color-primary);
  text-decoration: underline;
}

.markdown-body .md-img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 8px 0;
  display: block;
}

.markdown-body .task-item {
  list-style: none;
  margin-left: -22px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.markdown-body .task-item input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.markdown-body .task-item.task-done span {
  text-decoration: line-through;
  color: var(--color-text-tertiary);
}

/* 引用卡片（ref:// 链接）—— other 气泡：角色色配色 */
.markdown-body .ref-card,
.chat-row.other .chat-bubble .ref-card {
  --role-color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: color-mix(in srgb, var(--role-color) 14%, transparent);
  color: var(--role-color);
  border-radius: 12px;
  font-size: 0.9em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.chat-row.other .chat-bubble .ref-card {
  --role-color: inherit;
}
.markdown-body .ref-card:hover,
.chat-row.other .chat-bubble .ref-card:hover {
  background: color-mix(in srgb, var(--role-color) 24%, transparent);
  color: var(--role-color);
}
.markdown-body .ref-card.ref-deleted,
.chat-bubble .ref-card.ref-deleted {
  background: var(--color-surface-hover);
  color: var(--color-text-tertiary);
  text-decoration: line-through;
  cursor: default;
}

/* self 气泡内的 ref-card：角色色背景上的半透明白 */
.chat-row.self .chat-bubble .ref-card {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
}
.chat-row.self .chat-bubble .ref-card:hover {
  background: rgba(255, 255, 255, 0.32);
  color: #fff;
}
.chat-row.self .chat-bubble .ref-card.ref-deleted {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
}

/* chevron 把手（SVG） */
.ref-card .ref-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.75;
}
.ref-card .ref-chevron svg { display: block; }
.ref-card.ref-expanded .ref-chevron {
  transform: rotate(90deg);
}

/* 多个 link 同行换行时的间距 */
.chat-bubble .ref-card {
  margin: 2px 6px 2px 0;
}

/* ===== 消息引用（blockquote 样式） ===== */
.msg-quote {
  margin: 4px 0;
  padding: 6px 10px;
  border-left: 3px solid var(--role-color, var(--color-primary));
  background: color-mix(in srgb, var(--role-color, var(--color-primary)) 10%, transparent);
  border-radius: 0 6px 6px 0;
  font-size: 0.9em;
  line-height: 1.4;
}
.chat-row.self .msg-quote {
  border-left-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.12);
}
.msg-quote-role {
  font-weight: 600;
  color: var(--role-color, var(--color-primary));
  margin-bottom: 2px;
  font-size: 0.92em;
}
.chat-row.self .msg-quote-role {
  color: rgba(255, 255, 255, 0.9);
}
.msg-quote-text {
  color: var(--color-text-secondary);
  word-break: break-word;
}
.chat-row.self .msg-quote-text {
  color: rgba(255, 255, 255, 0.75);
}

/* ===== 预览面板字段样式 ===== */
.ref-field {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  line-height: 1.5;
}
.ref-field:last-child {
  margin-bottom: 0;
}
.ref-field-label {
  flex-shrink: 0;
  color: var(--color-text-tertiary);
  font-size: 0.85em;
  min-width: 36px;
}
.ref-field-value {
  flex: 1;
  word-break: break-word;
}
.ref-field-url {
  color: var(--color-primary);
  font-family: monospace;
  font-size: 0.88em;
}

/* 展开态：ref-card 宽度由内容决定，单行显示 */
.chat-bubble .ref-card.ref-expanded {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 4px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: width 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

/* 预览面板 —— flex 列布局：title 固定 / body 滚动 / footer 固定底部 */
.ref-preview {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 8px 12px 0;
  margin-bottom: 8px;
  font-size: 0.9em;
  color: var(--color-text);
  max-height: 25vh;
  overflow: hidden;
  animation: ref-preview-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes ref-preview-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
.ref-preview.ref-collapsing {
  animation: ref-preview-out 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes ref-preview-out {
  from {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    max-height: 25vh;
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
    filter: blur(6px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
  }
}
.chat-row.other .ref-preview {
  background: color-mix(in srgb, var(--role-color) 6%, var(--color-surface));
  border-color: color-mix(in srgb, var(--role-color) 20%, var(--color-border));
}
.chat-row.self .ref-preview {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}
.ref-preview-title {
  flex-shrink: 0;
  font-size: 1.12em;
  font-weight: 700;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* body 唯一可滚动区域 */
.ref-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  color: var(--color-text-secondary);
  line-height: 1.5;
  word-break: break-word;
  margin: 0;
  padding-right: 4px;
}
.chat-row.self .ref-preview-body {
  color: rgba(255, 255, 255, 0.75);
}
/* 合并引用（聊天记录）展开列表 */
.ref-merge-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ref-merge-item {
  font-size: var(--font-size-sm);
  line-height: 1.5;
  padding: 4px 0;
  border-bottom: 1px dashed var(--color-border-light);
}
.ref-merge-item:last-child { border-bottom: none; }
.ref-merge-sender {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-right: 4px;
}
.chat-row.self .ref-merge-sender { color: #fff; }
.ref-merge-text {
  color: var(--color-text-secondary);
  word-break: break-word;
}
.chat-row.self .ref-merge-text { color: rgba(255, 255, 255, 0.8); }
/* footer 固定底部，全宽高斯模糊渐变 */
.ref-preview-footer {
  flex-shrink: 0;
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 6px 0 8px;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}
/* 模糊层：上边界透明，下边界完全模糊 */
.ref-preview-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 45%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 45%);
  pointer-events: none;
  z-index: 0;
}
/* 渐变色底，配合模糊层过渡到预览底色 */
.ref-preview-footer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--color-surface) 65%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 45%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 45%);
  pointer-events: none;
  z-index: -1;
}
.chat-row.other .ref-preview-footer::after {
  background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--role-color) 6%, var(--color-surface)) 65%);
}
.chat-row.self .ref-preview-footer::after {
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.12) 65%);
}
.ref-preview-footer > * {
  position: relative;
  z-index: 1;
}
.ref-preview-detail-btn {
  font-size: 0.85em;
  padding: 5px 16px;
  border-radius: 12px;
  background: var(--role-color);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.chat-row.self .ref-preview-detail-btn {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.ref-preview-detail-btn:hover {
  opacity: 0.85;
}

/* ===== 进度环（自定义文本，如倒计时） ===== */
.progress-ring-label {
  position: absolute;
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

/* ===== 胶囊仓（沉浸模式） ===== */
body.capsule-mode .tab-bar { display: none; }
body.capsule-mode #router-outlet { bottom: 0 !important; }
/* 沉浸页内隐藏全局浮动入口（页内已有完整番茄钟） */
body.capsule-mode capsule-fab-el { display: none !important; }

/* ===== 胶囊仓全局浮动入口（固定右下角、Tab 栏上方、最上层） ===== */
capsule-fab-el {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tab-bar-height) + 12px);
  z-index: 500;
}

/* 外层只负责显隐；[hidden] 时彻底不可见 */
.capsule-fab { display: block; }
.capsule-fab[hidden] { display: none; }

/* 黄金比例胶囊：高 42px × 宽约 68px（1.618:1） */
.capsule-fab-pill {
  height: 42px;
  aspect-ratio: 1.618 / 1;
  border-radius: 999px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 122, 255, 0.38);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px 0 14px;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.capsule-fab-pill:active { transform: scale(0.96); }
.capsule-fab-pill.is-break { background: var(--color-success); box-shadow: 0 8px 22px rgba(52, 199, 89, 0.38); }
.capsule-fab-pill.is-paused { background: #8e8e93; box-shadow: 0 8px 22px rgba(142, 142, 147, 0.35); }

.fab-time {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  line-height: 1;
}

/* 右侧圆形继续/暂停按钮（Material 圆形 icon button） */
.fab-ctl {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.fab-ctl:active { transform: scale(0.9); }

/* ===== 打卡日历（checkin-calendar-el） ===== */
/* 已打卡=主题蓝；漏打=警告黄；未到=虚线；非打卡日=中性底 */
.cc-empty { font-size: var(--font-size-xs); color: var(--color-text-tertiary); padding: 12px 0; text-align: center; }

.cc-strip-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cc-strip-scroll::-webkit-scrollbar { display: none; }
.cc-strip { display: flex; gap: 6px; }
.cc-strip-cell {
  flex: 0 0 auto; width: 34px; padding: 5px 0; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--color-surface-hover); color: var(--color-text-secondary);
  user-select: none;
}
.cc-strip-wd { font-size: 10px; color: var(--color-text-tertiary); }
.cc-strip-day { font-size: 12px; font-weight: 600; }
.cc-strip-cell.is-checked { background: var(--color-primary); color: #fff; }
.cc-strip-cell.is-checked .cc-strip-wd { color: rgba(255,255,255,.82); }
.cc-strip-cell.is-missed { background: rgba(255,149,0,.16); color: var(--color-warning); }
.cc-strip-cell.is-missed .cc-strip-wd { color: var(--color-warning); }
.cc-strip-cell.is-future { background: transparent; border: 1px dashed var(--color-border); }
.cc-strip-cell.is-today { outline: 2px solid var(--color-primary); outline-offset: -1px; }

.cc-hm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cc-hm-scroll::-webkit-scrollbar { display: none; }
.cc-hm { display: grid; grid-template-columns: 16px auto; gap: 3px; width: max-content; margin: 0 auto; }
.cc-hm-corner { grid-column: 1; grid-row: 1; }
.cc-hm-months {
  grid-column: 2; grid-row: 1;
  display: grid; grid-auto-flow: column; grid-auto-columns: 30px;
  grid-template-rows: 14px; gap: 3px;
}
.cc-hm-month { font-size: 10px; color: var(--color-text-tertiary); line-height: 14px; white-space: nowrap; }
.cc-hm-weekdays {
  grid-column: 1; grid-row: 2;
  display: grid; grid-template-rows: repeat(7, 30px); gap: 3px;
}
.cc-hm-weekdays span { font-size: 10px; color: var(--color-text-tertiary); display: flex; align-items: center; justify-content: center; }
.cc-hm-grid {
  grid-column: 2; grid-row: 2;
  display: grid; grid-auto-flow: column; grid-auto-columns: 30px;
  grid-template-rows: repeat(7, 30px); gap: 3px;
}
.cc-hm-cell {
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--color-text-secondary);
  background: var(--color-surface-hover);
}
.cc-hm-blank { background: transparent; }
.cc-hm-cell.is-checked { background: var(--color-primary); color: #fff; font-weight: 600; }
.cc-hm-cell.is-missed { background: rgba(255,149,0,.18); color: var(--color-warning); }
.cc-hm-cell.is-future { background: transparent; border: 1px dashed var(--color-border); color: var(--color-text-tertiary); }
.cc-hm-cell.is-off { opacity: .55; }
.cc-hm-cell.is-today { outline: 2px solid var(--color-primary); outline-offset: -1px; }

.cc-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11px; color: var(--color-text-secondary); flex-wrap: wrap; }
.cc-lg { width: 11px; height: 11px; border-radius: 3px; display: inline-block; vertical-align: -1px; }
.cc-lg.is-checked { background: var(--color-primary); }
.cc-lg.is-missed { background: rgba(255,149,0,.55); }
.cc-lg.is-off { background: var(--color-surface-hover); }
.cc-lg.is-future { background: transparent; border: 1px dashed var(--color-border); }
.cc-legend-sum { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ===== 过期待办：不做卡片描边高亮，仅保留「已过期」胶囊，日程不做逾期提示 ===== */
.tag.tag-warning { background: rgba(255,149,0,.15); color: var(--color-warning); }

/* ===== 速记底部模态（quick-capture-sheet） ===== */
.qc-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.35);
  display: flex; flex-direction: column; justify-content: flex-end;
  animation: qc-fade .18s ease;
}
.qc-overlay.closing { animation: qc-fade-out .18s ease forwards; }
.qc-spacer { flex: 1; min-height: 0; }
/* 解析结果：位于白色输入卡片上方的遮罩层内，整体底对齐（1 条贴底，多条也贴底，条目自上而下排列）；
   wrap 不滚动，渐变环挂在 wrap 外边界；内部 qc-result 负责滚动 */
.qc-result-wrap {
  flex-shrink: 0;
  display: flex; flex-direction: column;
}
.qc-result {
  flex-shrink: 0;
  max-height: 44vh;
  padding: 12px 12px 6px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
}
.qc-sheet {
  background: var(--color-surface);
  border-radius: 18px 18px 0 0;
  padding: 4px 16px calc(10px + var(--safe-area-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,.18);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  animation: qc-slide .22s cubic-bezier(.2,.8,.2,1);
}
.qc-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--color-border); margin: 6px auto 8px; flex-shrink: 0; touch-action: none; cursor: grab; }
/* 引导语浮在深色遮罩上，用半透明深色底 + 浅色文字保证可读 */
.qc-guide {
  font-size: var(--font-size-xs); color: rgba(255,255,255,.92); line-height: 1.7;
  background: rgba(0,0,0,.42); border-radius: var(--radius-sm);
  padding: 10px 12px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
/* 速记追问 AI 对话区 */
.qc-chat { margin-top: 14px; border-radius: var(--radius-sm); overflow: hidden; }
.qc-chat-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--font-size-xs); color: rgba(255,255,255,.7);
  padding: 8px 12px; background: rgba(0,0,0,.35);
}
.qc-chat-round { opacity: .7; }
.qc-chat-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: rgba(0,0,0,.22); max-height: 220px; overflow-y: auto; }
.qc-chat-msg { display: flex; gap: 6px; align-items: flex-start; }
.qc-chat-role {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.qc-chat-msg.is-user { flex-direction: row-reverse; }
.qc-chat-msg.is-user .qc-chat-role { background: var(--color-primary, #6366f1); color: #fff; }
.qc-chat-msg.is-ai .qc-chat-role { background: rgba(216,180,74,.3); color: #e4c25f; }
.qc-chat-body {
  max-width: calc(100% - 32px); padding: 7px 10px; border-radius: 10px;
  font-size: var(--font-size-xs); line-height: 1.6; word-break: break-word;
}
.qc-chat-msg.is-user .qc-chat-body { background: var(--color-primary, #6366f1); color: #fff; }
.qc-chat-msg.is-ai .qc-chat-body { background: rgba(255,255,255,.1); color: #f4f1ff; }
.qc-chat-inputbar { display: flex; gap: 8px; padding: 10px; background: rgba(0,0,0,.35); align-items: flex-end; }
.qc-chat-input {
  flex: 1; resize: none; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  color: #f4f1ff; padding: 8px 10px; font-size: var(--font-size-xs); font-family: inherit;
  min-height: 34px; max-height: 80px;
}
.qc-chat-caret { display: inline-block; animation: qc-blink 1s steps(1) infinite; color: #e4c25f; }
@keyframes qc-blink { 50% { opacity: 0; } }
.qc-item { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border-radius: var(--radius-sm); background: var(--color-surface); border: 1px solid var(--color-border-light); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.qc-item.is-off { opacity: .45; }
.qc-item-title { font-size: var(--font-size-sm); font-weight: 500; word-break: break-word; }
.qc-item-sub { font-size: var(--font-size-xs); color: var(--color-text-secondary); margin-top: 3px; word-break: break-word; }
.qc-nohint { font-size: 10px; color: var(--color-text-tertiary); text-align: center; padding-top: 6px; }
.qc-actions { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px 8px; flex-shrink: 0; }
.qc-actions-right { display: flex; align-items: center; gap: 10px; }
/* 「笔记」按钮：圆形 icon，蓝色高亮但比确认按钮略浅 */
.qc-note-icon {
  background: #5ea9ff;
  color: #fff;
  box-shadow: 0 4px 12px rgba(94,169,255,.4);
}
.qc-note-icon:disabled { opacity: .4; box-shadow: none; }
.qc-icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform var(--transition-fast);
}
.qc-icon-btn:active { transform: scale(.9); }
.qc-cancel { background: var(--color-surface-hover); color: var(--color-text-secondary); }
.qc-confirm { background: var(--color-primary); color: #fff; box-shadow: 0 4px 12px rgba(0,122,255,.35); }
.qc-confirm:disabled { opacity: .4; box-shadow: none; }
.qc-inputbar { display: flex; align-items: flex-end; gap: 8px; background: var(--color-surface-hover); border-radius: 22px; padding: 8px 14px; flex-shrink: 0; }
.qc-input { flex: 1; border: none; background: transparent; resize: none; outline: none; font-size: var(--font-size-base); font-family: inherit; max-height: 96px; line-height: 1.4; color: var(--color-text-primary); }
@keyframes qc-slide { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes qc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes qc-fade-out { to { opacity: 0; } }

/* 小转圈（速记模态 / Banner 共用） */
.qc-spinner {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  display: inline-block; animation: qc-spin .7s linear infinite;
}
@keyframes qc-spin { to { transform: rotate(360deg); } }
.qc-parsing { display: flex; align-items: center; gap: 8px; }

/* ===== 蓝紫流动渐变描边（只画在宿主元素最外边界上的 2px 环，不占用布局） ===== */
@property --cap-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.cap-ring { position: relative; }
.cap-ring::before {
  content: ''; position: absolute; inset: 0; z-index: 5;
  border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--cap-angle, 0deg),
    #6a5cff 0deg, #3b82f6 90deg, #22d3ee 160deg, #a855f7 240deg, #6a5cff 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.cap-ring.is-parsing::before { animation: cap-rotate 2.4s linear infinite; }
.cap-ring.is-error::before {
  background: conic-gradient(from var(--cap-angle, 0deg),
    #6a5cff, #3b82f6, #f59e0b, #6a5cff);
}
@keyframes cap-rotate { to { --cap-angle: 360deg; } }
/* 不支持 @property 的浏览器兜底：渐变静止也可接受 */

/* ===== 任务页顶部速记进度 Banner ===== */
.cap-banner {
  margin: 0 0 12px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(80,70,200,.14);
  animation: cap-banner-in .22s ease;
}
@keyframes cap-banner-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cap-banner-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px 7px 6px; min-height: 38px;
}
.cap-banner-chevron {
  border: none; background: transparent; padding: 4px;
  font-size: 12px; line-height: 1; color: var(--color-text-tertiary);
  cursor: pointer; flex-shrink: 0;
}
.cap-banner-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 2px 2px;
}
.cap-banner-label {
  font-size: 11px; font-weight: 700; color: #6a5cff; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
}
.cap-banner .qc-spinner {
  border-color: rgba(106,92,255,.25); border-top-color: #6a5cff;
}
.cap-banner-text {
  font-size: 12px; color: var(--color-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cap-banner-actions { display: flex; gap: 2px; flex-shrink: 0; }
.cap-banner-actions .btn { min-height: 28px; padding: 0 10px; font-size: 12px; }
.cap-banner-panel {
  border-top: 1px solid var(--color-border-light);
  padding: 8px; display: flex; flex-direction: column; gap: 8px;
  max-height: 42vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--color-bg);
}
.cap-banner-hint {
  font-size: 12px; color: var(--color-text-secondary);
  padding: 4px; display: flex; gap: 6px; align-items: center; line-height: 1.5;
}
#cap-banner-slot.is-error .cap-banner-label { color: #b45309; }
.cap-banner-panel .qc-item { box-shadow: none; }

/* 渐变环只挂在两个宿主的外边界：任务页 Banner 插槽、模态结果区包裹层 */
#cap-banner-slot.cap-ring { border-radius: 14px; }
#qc-result-wrap.cap-ring { border-radius: 14px; }

/* ===== 设置：全局模型启用开关 ===== */
.cap-enable-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; margin-bottom: 12px;
  border: 1px solid var(--color-border-light); border-radius: var(--radius-md);
  background: var(--color-surface-hover);
}
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer;
}
.switch-slider {
  position: absolute; inset: 0; border-radius: 26px;
  background: #c7c7cc; transition: background .25s; cursor: pointer;
}
.switch-slider::before {
  content: ''; position: absolute; height: 22px; width: 22px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: transform .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.switch input:checked + .switch-slider {
  background: linear-gradient(120deg, #6a5cff, #3b82f6);
}
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
#cap-fields[data-disabled="1"] { opacity: .5; pointer-events: none; }

/* ===== 塔罗（内观 · insight-tarot） ===== */
.tarot-page {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #241d47 0%, #171332 55%, #100d24 100%);
  color: #e9e4ff;
}
.tarot-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.tarot-floor {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
}
.tarot-floor0 {
  z-index: 2;
  background: radial-gradient(120% 80% at 50% 0%, #241d47 0%, #171332 55%, #100d24 100%);
  will-change: transform;
  touch-action: none;
}
.tarot-floor0[style*="translateY"] { box-shadow: 0 -12px 36px rgba(0,0,0,.5); }
.tarot-floor1 {
  /* 地下一层：默认位于牌桌正下方（屏幕之外 translateY(100%)）；
     牌桌上滑后它从下方升入视口，牌桌自身则上移移出视口。 */
  inset: auto; left: 0; right: 0; top: 0; height: 100%;
  transform: translateY(100%);
  z-index: 3;
  background: linear-gradient(180deg, #1b1638 0%, #120f28 100%);
}
.tarot-ai-dragbar { touch-action: none; }

.tarot-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + var(--safe-area-top)) 12px 8px; flex-shrink: 0;
}
.tarot-title { font-size: var(--font-size-md); font-weight: 700; letter-spacing: 1px; }
.tarot-header .btn { color: #d8d2ff; }

.tarot-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 12px 10px; flex-shrink: 0; flex-wrap: wrap;
}
.tarot-spread-seg { flex: 1; min-width: 200px; }
.tarot-toolbar .btn { white-space: nowrap; }

.tarot-canvas {
  position: relative; flex: 1; min-height: 0; margin: 0 10px;
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid rgba(216,180,74,.28);
  background:
    radial-gradient(80% 60% at 50% 35%, rgba(122,92,255,.16), transparent 70%),
    rgba(0,0,0,.18);
  touch-action: none;   /* 整块画布用于上滑翻层 / 自定义拖牌 */
}
.tarot-canvas-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  color: rgba(233,228,255,.55); font-size: var(--font-size-sm); line-height: 1.8;
  pointer-events: none;
}
.tarot-cards { position: absolute; inset: 0; }

.tarot-card {
  position: absolute;
  width: 30%; max-width: 150px;
  aspect-ratio: 240 / 400;
  transform: translate(-50%, -50%);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;   /* 单击翻牌 / 自定义牌阵拖牌都不与滚动手势冲突 */
  z-index: 2;
}
.spread-three .tarot-card { width: 26%; max-width: 132px; }
.spread-custom .tarot-card { width: 21%; max-width: 112px; }
.tarot-card.is-dragging { z-index: 10; cursor: grabbing; }

/*
 * 翻牌实现（终态显隐用离散 display，任何 WebView 都不可能出现“永远是背面”）：
 *   - 默认只显示背面，正面 display:none；
 *   - .is-flipped 时背面 display:none、正面 display:block，并播放一次翻入动画；
 *   - 不依赖 backface-visibility / opacity 过渡时序 / 新建元素过渡等易失效特性。
 */
.tarot-card { perspective: 900px; }
.tarot-card-inner {
  position: relative; width: 100%; height: 100%;
}
.tarot-face {
  position: absolute; inset: 0;
  border-radius: 10px; overflow: hidden;
  background: #1b1738;
  box-shadow: 0 6px 12px rgba(0,0,0,.45);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.tarot-face img { width: 100%; height: 100%; display: block; user-select: none; }
.tarot-face-front { display: none; }
.tarot-card-inner.is-flipped .tarot-face-back { display: none; }
.tarot-card-inner.is-flipped .tarot-face-front {
  display: block;
  animation: tarot-flip-in .45s cubic-bezier(.2,.7,.3,1);
}
@keyframes tarot-flip-in {
  0%   { transform: rotateY(88deg); }
  100% { transform: rotateY(0deg); }
}
/* 逆位：正面图片自身倒置 180° */
.tarot-card-inner.is-reversed .tarot-face-front img { transform: rotate(180deg); }
.tarot-card-name {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  font-size: 10px; white-space: nowrap; color: #e4c25f;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.tarot-slot-captions {
  position: absolute; left: 0; right: 0; bottom: 14px;
  display: flex; justify-content: space-around;
  padding: 0 6%; pointer-events: none;
  color: rgba(228,194,95,.85); font-size: 11px; letter-spacing: 2px;
}
/* 发牌/洗牌动效 */
.tarot-card.is-dealing .tarot-card-inner { animation: tarot-deal .34s cubic-bezier(.2,.8,.3,1) backwards; }
.tarot-card.is-dealt .tarot-card-inner { animation: tarot-pop .3s ease; }
.tarot-cards.is-shuffling .tarot-card-inner { animation: tarot-shuffle .42s ease; }
@keyframes tarot-deal {
  from { transform: translateY(60px) scale(.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes tarot-pop {
  0% { transform: scale(.7); } 60% { transform: scale(1.08); } 100% { transform: none; }
}
@keyframes tarot-shuffle {
  0% { transform: translateX(0) rotate(0); }
  30% { transform: translateX(-10px) rotate(-5deg); }
  60% { transform: translateX(10px) rotate(5deg); opacity: .4; }
  100% { transform: none; opacity: 1; }
}

.tarot-dealbar {
  display: flex; gap: 10px; justify-content: center;
  padding: 12px 12px 6px; flex-shrink: 0;
}
.tarot-dealbar .btn { min-width: 132px; }
.tarot-swipe-hint {
  text-align: center; font-size: 11px; color: rgba(233,228,255,.5);
  padding: 6px 0 calc(8px + var(--safe-area-bottom)); flex-shrink: 0; cursor: pointer;
}

/* 地下一层 AI */
.tarot-ai-dragbar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-area-top)) 12px 8px; flex-shrink: 0;
  color: #e9e4ff; border-bottom: 1px solid rgba(255,255,255,.07);
  touch-action: none;
}
.tarot-drag-grip {
  width: 34px; height: 4px; border-radius: 2px;
  background: rgba(233,228,255,.35); margin: 0 2px;
}
.tarot-ai-dragbar .btn { color: #d8d2ff; }
.tarot-ai-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 32px; -webkit-overflow-scrolling: touch; }
.tarot-ai-empty {
  padding: 60px 24px; text-align: center; line-height: 1.9;
  color: rgba(233,228,255,.6); font-size: var(--font-size-sm);
}
.tarot-ai-cards {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px;
  -webkit-overflow-scrolling: touch;
}
.tarot-mini { flex: 0 0 auto; width: 84px; text-align: center; }
.tarot-mini-slot { font-size: 11px; color: #e4c25f; margin-bottom: 4px; letter-spacing: 1px; }
.tarot-mini-card {
  width: 84px; aspect-ratio: 240/400; border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,.4); background: #1b1738;
}
.tarot-mini-card img { width: 100%; height: 100%; display: block; user-select: none; }
.tarot-mini-card.is-rev img { transform: rotate(180deg); }
.tarot-mini-name { font-size: 11px; margin-top: 6px; color: #e9e4ff; }
.tarot-mini-pos { font-size: 10px; color: rgba(233,228,255,.55); margin-top: 1px; }

.tarot-ai-form { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #e9e4ff; }
.tarot-ai-form .form-label { color: #d8d2ff; }
.tarot-ai-input {
  width: 100%; resize: vertical; border-radius: var(--radius-sm);
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.14);
  color: #f4f1ff; padding: 10px; font-size: var(--font-size-sm); font-family: inherit;
}
.tarot-ai-answer { background: rgba(255,255,255,.06); border-color: rgba(216,180,74,.3); color: #ece8ff; }
.tarot-ai-answer-meta { font-size: 11px; color: rgba(233,228,255,.5); margin-bottom: 8px; }

/* 塔罗 AI 多轮对话气泡 */
#tarot-ai-conv { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.tarot-ai-msg { display: flex; gap: 8px; align-items: flex-start; }
.tarot-ai-msg-role {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.tarot-ai-msg.is-user { flex-direction: row-reverse; }
.tarot-ai-msg.is-user .tarot-ai-msg-role { background: var(--color-primary, #6366f1); color: #fff; }
.tarot-ai-msg.is-ai .tarot-ai-msg-role { background: rgba(216,180,74,.25); color: #e4c25f; }
.tarot-ai-msg-body {
  max-width: calc(100% - 40px); padding: 10px 12px; border-radius: 12px;
  font-size: var(--font-size-sm); line-height: 1.7; word-break: break-word;
}
.tarot-ai-msg.is-user .tarot-ai-msg-body {
  background: var(--color-primary, #6366f1); color: #fff; border-top-right-radius: 4px;
}
.tarot-ai-msg.is-ai .tarot-ai-msg-body {
  background: rgba(255,255,255,.07); color: #ece8ff; border-top-left-radius: 4px;
}
.tarot-ai-msg-body.markdown-body :is(h1,h2,h3,h4) { color: inherit; }
.tarot-ai-msg-body.markdown-body code { background: rgba(0,0,0,.2); padding: 1px 5px; border-radius: 3px; }
.tarot-ai-caret { display: inline-block; animation: tarot-blink 1s steps(1) infinite; color: #e4c25f; }
@keyframes tarot-blink { 50% { opacity: 0; } }
.tarot-meaning-row { padding: 8px 2px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: var(--font-size-sm); }
.tarot-meaning-row:last-child { border-bottom: none; }
.tarot-meaning-kw { font-size: var(--font-size-xs); color: rgba(233,228,255,.65); margin-top: 3px; line-height: 1.6; }

/* 弹层 / 抽屉（深色塔罗主题） */
.tarot-modal-root { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.tarot-modal-overlay, .tarot-drawer-overlay, .tarot-detail-overlay {
  position: absolute; inset: 0; pointer-events: auto;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  animation: qc-fade .2s ease;
}
.tarot-modal {
  width: calc(100% - 32px); max-width: 420px; max-height: 78%;
  display: flex; flex-direction: column;
  background: #211b42; color: #e9e4ff;
  border: 1px solid rgba(216,180,74,.3);
  border-radius: var(--radius-md); padding: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.tarot-modal-title { font-weight: 700; margin-bottom: 12px; }
.tarot-scope-body { overflow-y: auto; flex: 1; min-height: 0; }
.tarot-scope-tip { font-size: var(--font-size-xs); color: rgba(233,228,255,.6); line-height: 1.7; padding: 8px 0; }
.tarot-scope-group { margin-bottom: 12px; }
.tarot-scope-group-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #e4c25f; margin-bottom: 6px;
}
.tarot-scope-all {
  border: none; background: none; padding: 0;
  color: #9d8cff; font-size: 12px; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.tarot-scope-all:active { opacity: .6; }
.tarot-scope-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tarot-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; cursor: pointer;
  color: rgba(233,228,255,.85);
}
.tarot-chip.on { border-color: #a78bfa; background: rgba(124,98,255,.3); color: #fff; }
.tarot-chip input { -webkit-appearance: none; appearance: none; width: 0; height: 0; margin: 0; }

.tarot-drawer-overlay { justify-content: flex-end; align-items: stretch; }
.tarot-drawer {
  width: 86%; max-width: 340px; height: 100%;
  background: #211b42; color: #e9e4ff;
  border-left: 1px solid rgba(216,180,74,.3);
  display: flex; flex-direction: column;
  animation: tarot-drawer-in .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes tarot-drawer-in { from { transform: translateX(100%); } to { transform: none; } }
.tarot-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--safe-area-top)) 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.tarot-drawer-head .btn { color: #d8d2ff; }
.tarot-drawer-body { flex: 1; overflow-y: auto; padding: 10px 12px; -webkit-overflow-scrolling: touch; }
.tarot-drawer-item {
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04); cursor: pointer;
}
.tarot-drawer-item:active { background: rgba(255,255,255,.09); }
.tarot-drawer-item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.tarot-drawer-date { font-size: 10px; color: rgba(233,228,255,.55); margin-left: 8px; }
.tarot-drawer-cards { font-size: 12px; color: #d8d2ff; line-height: 1.5; }
.tarot-drawer-ai { font-size: 10px; color: #e4c25f; margin-top: 4px; }
.tarot-drawer-del {
  border: none; background: none; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 2px 4px; opacity: .65;
  border-radius: 6px; margin-left: auto;
}
.tarot-drawer-del:hover { opacity: 1; background: rgba(255,255,255,.08); }

.tarot-detail-overlay { align-items: stretch; justify-content: center; }
.tarot-detail {
  width: 100%; max-width: 480px; height: 100%;
  background: #1d1839; color: #e9e4ff;
  display: flex; flex-direction: column;
  border-left: 1px solid rgba(216,180,74,.25);
  border-right: 1px solid rgba(216,180,74,.25);
}
.tarot-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--safe-area-top)) 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.tarot-detail-head .btn { color: #d8d2ff; }
.tarot-detail-scroll { flex: 1; overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }

/* ===== 账号与同步 ===== */
.cloud-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
}

.capsule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.capsule-header-title {
  font-size: var(--font-size-md);
  font-weight: 600;
}

.capsule-task-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.capsule-task-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  line-height: 1.35;
}

.capsule-task-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

.capsule-task-time {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  margin-top: 8px;
}

.capsule-note-excerpt {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== 番茄钟 ===== */
.pomodoro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 0 8px;
}

.pomodoro-mode {
  font-size: var(--font-size-base);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.pomodoro-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.pomodoro-count b {
  color: var(--color-primary);
  font-size: var(--font-size-md);
}

.pomodoro-controls {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.pomodoro-controls .btn {
  min-width: 84px;
}

/* ===== 复选框（恢复原生外观） ===== */
input[type="checkbox"] {
  -webkit-appearance: auto;
  appearance: auto;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

/* ===== 心情选择器 ===== */
.mood-selector {
  display: flex;
  gap: 8px;
}

.mood-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.mood-item.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-2px);
}

.mood-emoji { font-size: 22px; line-height: 1; }

.mood-label { font-size: 10px; color: var(--color-text-secondary); }

.mood-item.active .mood-label { color: var(--color-primary); }

/* ===== 人生进度条 ===== */
.life-progress {
  text-align: center;
  padding: 24px;
}

.life-progress-title {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.life-progress-days {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: 4px;
}

.life-progress-sub {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.life-progress-track {
  position: relative;
  height: 6px;
  background: var(--color-border-light);
  border-radius: 3px;
  overflow: hidden;
}

.life-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  border-radius: 3px;
  transition: width 1s ease;
}

/* ===== 心情热力图（12 列 × 7 天 = 近 12 周，每列一个自然周）===== */
.mood-heatmap {
  display: flex;
  align-items: stretch;
  gap: 5px;
}

/* 左侧星期标签列，行高/间距与格子严格对齐 */
.heat-weekdays {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  gap: 3px;
  padding-top: 18px; /* 让出月份标注行 */
  flex-shrink: 0;
}

.heat-weekdays span {
  height: 13px;
  line-height: 13px;
  width: 12px;
  text-align: center;
  font-size: 9px;
  color: var(--color-text-tertiary);
}

.heat-grid { flex: 0 0 auto; }

/* 弹性间隔：把图注推到热力图右侧 */
.heat-spacer { flex: 1 1 auto; min-width: 8px; }

/* 右侧纵向图注：多 → 少，与热力图格子行区域居中对齐 */
.heat-legend {
  flex: 0 0 auto;
  padding-top: 18px; /* 与月份标注行对齐 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.heat-legend-text {
  font-size: 9px;
  line-height: 11px;
  color: var(--color-text-tertiary);
}

/* 月份标注行与下方周列共用同一套 12 列轨道 */
.heat-months {
  display: grid;
  grid-template-columns: repeat(12, 13px);
  gap: 3px;
  height: 16px;
  margin-bottom: 2px;
}

.heat-month {
  font-size: 9px;
  line-height: 16px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

/* 12 列固定轨道：恰好 12 周，每列内部纵向排 7 天（周日→周六）*/
.heat-cols {
  display: grid;
  grid-template-columns: repeat(12, 13px);
  gap: 3px;
}

.heat-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heat-cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
}

.heat-none {
  background: var(--color-surface-hover);
  box-shadow: inset 0 0 0 1px var(--color-border);
}
.heat-future { background: transparent; }
.heat-very-bad { background: var(--color-mood-2); }
.heat-bad { background: var(--color-mood-1); }
.heat-neutral { background: var(--color-mood-0); }
.heat-good { background: var(--color-mood-1p); }
.heat-very-good { background: var(--color-mood-2p); }

/* ===== 正念计时 / 复选行 ===== */
.mindset-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mindset-time {
  font-size: var(--font-size-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 64px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  padding: 6px 0;
}

/* ===== 与自己对话 ===== */
.message-item { cursor: pointer; }

.message-excerpt {
  font-size: var(--font-size-base);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.reply-hint {
  font-size: var(--font-size-sm);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.reply-hint.waiting { background: rgba(255, 149, 0, 0.12); color: var(--color-warning); }
.reply-hint.ready { background: rgba(52, 199, 89, 0.12); color: var(--color-success); }

/* ===== 故事板时间线 ===== */
.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--color-border);
}

.timeline-date {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 16px 0 8px;
}

.timeline-item { position: relative; margin-bottom: 12px; }

.timeline-dot {
  position: absolute;
  left: -19px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
  z-index: 1;
}

.timeline-dot.future { background: var(--color-success); }

.timeline-card { margin-bottom: 0; cursor: pointer; }

/* ===== 内观入口卡片 ===== */
.entry-card { cursor: pointer; }

/* ===== 日历格子状态 ===== */
.calendar-cell {
  position: relative;
  min-height: 40px;
  padding: 3px 2px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.calendar-cell .cal-day {
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: 1.4;
}
.calendar-cell.is-other { opacity: 0.3; }
/* 今天：实心蓝底白字 */
.calendar-cell.is-today {
  background: var(--color-primary);
}
.calendar-cell.is-today .cal-day { color: #fff; font-weight: 700; }
.calendar-cell.is-today .cal-dots > i { background: #fff !important; }
/* 选中：无底色，蓝色描边 */
.calendar-cell.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.calendar-cell.is-today.is-selected { background: var(--color-primary); }
.cal-dots { display: flex; justify-content: center; gap: 2px; margin-top: 2px; }
.cal-dots > i { width: 4px; height: 4px; border-radius: 50%; background: var(--color-primary); }

/* ===== 左侧抽屉（对话历史） ===== */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 300; animation: fade-in 0.2s ease;
}
.drawer-mask.closing { animation: fade-out 0.2s ease forwards; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 82%; max-width: 320px;
  background: var(--color-surface); z-index: 301;
  display: flex; flex-direction: column;
  animation: drawer-in 0.28s cubic-bezier(0.32,0.72,0,1);
  box-shadow: var(--shadow-lg);
}
.drawer-mask.closing .drawer { animation: drawer-out 0.22s ease forwards; }
@keyframes drawer-in  { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes drawer-out { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.drawer-header {
  padding: calc(16px + var(--safe-area-top, 0px)) 16px 12px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-title { font-size: var(--font-size-md); font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px; }
.drawer-conv {
  padding: 12px; border-radius: var(--radius-md); cursor: pointer;
  transition: background var(--transition-fast); margin-bottom: 2px;
}
.drawer-conv:active, .drawer-conv.active { background: var(--color-primary-light); }
.drawer-conv-title {
  font-size: var(--font-size-base); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drawer-conv-sub {
  font-size: var(--font-size-xs); color: var(--color-text-secondary); margin-top: 3px;
  display: flex; gap: 8px; align-items: center;
}

/* ===== 对话页（智能体 App 风格） ===== */
.chat-shell { display: flex; flex-direction: column; height: 100%; }
.chat-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; padding-top: calc(8px + var(--safe-area-top, 0px));
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface); flex-shrink: 0;
}
.chat-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 12px; background: var(--color-bg);
}

/* 日期分割线：居中显示，作为不同日期对话组的分隔 */
.chat-divider {
  display: flex; align-items: center; justify-content: center;
  margin: 18px 0 14px;
}
.chat-divider span {
  font-size: var(--font-size-xs); color: var(--color-text-tertiary);
  background: var(--color-surface-hover);
  padding: 3px 12px; border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
}

/* 消息行：左侧头像+角色名（上下排列），右侧气泡+时间（左右排列） */
.chat-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }

/* 多选模式 */
.chat-row.msg-selected { background: rgba(59,130,246,0.08); border-radius: 12px; }
.msg-select-check {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--color-border); background: var(--color-surface);
  cursor: pointer; padding: 0; align-self: center; margin-right: 4px;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.msg-select-check.checked {
  background: var(--color-primary); border-color: var(--color-primary);
}
.msg-select-check.checked::after {
  content: ''; width: 10px; height: 6px; border-left: 2px solid #fff;
  border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px,-1px);
}
.chat-bar-select { padding: 10px 14px; align-items: center; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chat-bar-select::-webkit-scrollbar { display: none; }
.select-count { font-size: var(--font-size-sm); color: var(--color-text-secondary); flex-shrink: 0; }
.chat-bar-select .btn { padding: 8px 14px; font-size: var(--font-size-sm); flex-shrink: 0; }

/* AI 处理中 loading 动画 */
.ai-streaming-dot {
  display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-radius: 50%; background: currentColor; opacity: .6;
  vertical-align: middle;
  animation: ai-streaming-blink 1s infinite;
}
@keyframes ai-streaming-blink {
  0%, 100% { opacity: .2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}


/* 左侧角色列：头像在上、角色名在下 */
.chat-actor {
  flex: 0 0 38px;
  width: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

/* 角色头像 */
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff;
}

/* 角色名限制宽度，超出省略号截断 */
.chat-role {
  max-width: 38px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--color-text-secondary);
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 气泡主体列 */
.chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* 气泡 + 时间 同排横排：气泡在左，时间在右 */
.chat-line { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }

.chat-time {
  font-size: 10px; color: var(--color-text-tertiary);
  flex-shrink: 0; padding-bottom: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 单条消息操作入口（编辑 / 删除） */
.chat-ops {
  flex-shrink: 0;
  align-self: flex-end;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  color: var(--color-text-tertiary);
  opacity: 0.35;
  padding: 0;
  border-radius: 50%;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}
.chat-ops:active,
.chat-row:hover .chat-ops { opacity: 1; }
.chat-ops:active { background: var(--color-surface-hover); }

/* 气泡内只显示文字内容；最宽为屏幕一半，超出自动换行 */
.chat-bubble {
  width: fit-content;
  max-width: 50vw;
  padding: 9px 13px; border-radius: 17px;
  font-size: var(--font-size-base); line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  animation: bubble-in 0.22s ease;
  min-width: 0;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }

.chat-row.self .chat-bubble {
  background: var(--role-color); color: #fff;
  border-bottom-left-radius: 5px;
}
.chat-row.other .chat-bubble {
  background: color-mix(in srgb, var(--role-color) 12%, var(--color-surface));
  color: var(--color-text);
  border: none;
  border-bottom-left-radius: 5px;
}

/* link 展开时气泡撑满可用宽度 */
.chat-bubble.bubble-ref-expanded {
  max-width: 100% !important;
  width: 100% !important;
  flex: 1 1 100%;
}

/* 展开时，气泡内除 ref-card 和预览外的文字内容位移+模糊过渡 */
.chat-bubble.bubble-ref-expanded > *:not(.ref-card):not(.ref-preview) {
  animation: ref-content-shift 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes ref-content-shift {
  from {
    opacity: 0;
    transform: translateY(-10px);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* 折叠时，文字内容反向位移+淡出+模糊 */
.chat-bubble.bubble-ref-collapsing > *:not(.ref-card):not(.ref-preview) {
  animation: ref-content-shift-out 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes ref-content-shift-out {
  from {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
    filter: blur(5px);
  }
}

/* 气泡下方的小标记（心情 / 阅后即焚；不显示正念时间） */
.chat-flags { display: flex; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
.chat-flag {
  font-size: 9px; color: var(--color-text-tertiary);
  background: var(--color-surface-hover);
  padding: 1px 6px; border-radius: var(--radius-full);
}

/* 通用角色胶囊（编辑消息弹窗等） */
.role-chip {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 5px 11px; border-radius: var(--radius-full);
  font-size: var(--font-size-sm); font-weight: 500;
  background: var(--color-surface-hover); color: var(--color-text-secondary);
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--transition-fast);
}
.role-chip .role-emoji { font-size: 14px; line-height: 1; }
.role-chip.active { color: #fff; border-color: transparent; }

/* 底部对话输入条 */
.chat-bar {
  flex-shrink: 0; display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 12px; padding-bottom: calc(8px + var(--safe-area-bottom));
  background: var(--color-surface);
  transition: gap var(--transition-normal);
}
/* 输入框获焦：隐藏头像与加号，输入框左边界延伸覆盖其宽度 */
.chat-bar.bar-focused { gap: 0; }
.chat-bar.bar-focused .chat-avatar-btn,
.chat-bar.bar-focused .chat-tool-btn {
  width: 0; opacity: 0; margin: 0; padding: 0; overflow: hidden;
  pointer-events: none;
}
.chat-bar .chat-avatar-btn,
.chat-bar .chat-tool-btn {
  transition: width var(--transition-normal), opacity var(--transition-normal),
              margin var(--transition-normal), padding var(--transition-normal);
}
.chat-bar.bar-focused .chat-input-wrap {
  margin-left: 0;
}
.chat-avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; border: none; cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-normal);
}
.chat-avatar-btn:active { transform: scale(0.9); }
.chat-avatar-btn.role-switch { animation: avatarPop 0.3s ease; }
@keyframes avatarPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.chat-input-wrap {
  flex: 1; position: relative; display: flex; align-items: flex-end;
}
.chat-bar textarea {
  flex: 1; max-height: 120px; resize: none;
  border-radius: var(--radius-lg); padding: 9px 38px 9px 14px;
  background: var(--color-surface-hover); border: 1px solid transparent;
}
.chat-bar textarea:focus { border-color: var(--color-primary); background: var(--color-surface); }
.chat-expand-btn {
  position: absolute; right: 6px; bottom: 8px;
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--color-surface); color: var(--color-text-secondary);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border-light); z-index: 5;
  transition: all var(--transition-fast);
}
.chat-expand-btn:hover { background: var(--color-primary-light); color: var(--color-primary); }
.chat-send {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.chat-send:disabled { opacity: 0.4; }
.chat-send:active:not(:disabled) { transform: scale(0.9); }

.chat-tool-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-surface-hover); color: var(--color-text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.chat-tool-btn:active { transform: scale(0.9); background: var(--color-primary-light); color: var(--color-primary); }

/* 全屏输入模式（3/4 窗口高度，模态叠加层，位于 tab 栏上方） */
.chat-bar-fullscreen {
  position: fixed; left: 0; right: 0;
  bottom: var(--tab-bar-total);
  height: 75vh;
  flex-direction: column; align-items: stretch;
  padding: 12px 16px;
  background: var(--color-surface); z-index: 200; gap: 10px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
}
.chat-bar-fullscreen.fs-enter { animation: fsEnter 0.28s cubic-bezier(0.22,1,0.36,1) forwards; }
.chat-bar-fullscreen.fs-leave { animation: fsLeave 0.22s cubic-bezier(0.4,0,1,1) forwards; }
@keyframes fsEnter {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fsLeave {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(100%); }
}
.fs-top-row {
  display: flex; justify-content: flex-end;
  flex-shrink: 0;
}
.fs-top-row .chat-collapse-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-surface-hover); color: var(--color-text-secondary);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  transition: background var(--transition-fast);
}
.fs-top-row .chat-collapse-btn:hover { background: var(--color-border-light); }
.fs-spacer { flex: 0 0 32px; }
.fs-input-wrap {
  flex: 1; display: flex; min-height: 0;
}
.fs-input-wrap textarea {
  flex: 1; width: 100%; box-sizing: border-box;
  min-height: 0; height: 100%;
  max-height: none !important;
  resize: none;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  background: var(--color-surface-hover);
  border: 1px solid transparent;
  font-size: var(--font-size-base);
  line-height: 1.6;
}
.fs-input-wrap textarea:focus {
  outline: none; border-color: var(--color-primary); background: var(--color-surface);
}
.fs-bottom-row {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 12px; flex-shrink: 0;
}
.fs-counter {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}
.fs-bottom-row .chat-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.fs-bottom-row .chat-send:disabled { opacity: 0.4; }
.fs-bottom-row .chat-send:active:not(:disabled) { transform: scale(0.9); }

/* 弹出菜单 */
.chat-popup-menu {
  position: fixed; z-index: 200;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border: 1px solid var(--color-border-light);
  padding: 8px; min-width: 160px;
  max-height: 55vh; overflow-y: auto;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom left;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.chat-popup-menu::-webkit-scrollbar { width: 6px; }
.chat-popup-menu::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
.chat-popup-menu.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.chat-popup-menu.closing {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  pointer-events: none;
}
.chat-popup-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border: none;
  background: transparent; color: var(--color-text);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--font-size-base); text-align: left;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.chat-popup-item:hover { background: var(--color-surface-hover); }
.chat-popup-item:active { transform: scale(0.97); }
.chat-popup-item.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }
.chat-popup-label { flex: 1; }
.chat-popup-check { color: var(--color-primary); flex-shrink: 0; }
.chat-popup-divider { height: 1px; background: var(--color-border-light); margin: 4px 0; }

/* AI 数据访问权限分段控件 */
.ai-data-access {
  display: flex; gap: 0;
  background: var(--color-surface-hover);
  border-radius: var(--radius-md);
  padding: 3px;
}
.ai-da-btn {
  flex: 1; padding: 8px 6px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-text-secondary);
  font-size: var(--font-size-sm); font-weight: 500; cursor: pointer;
  transition: all var(--transition-fast);
}
.ai-da-btn.active {
  background: var(--color-primary); color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* 对话 @ 提及 */
.chat-mention {
  display: inline-block; padding: 1px 6px; margin: 0 1px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light); color: var(--color-primary);
  font-weight: 600; font-size: 0.95em;
}
/* 自己气泡为角色色背景，@ 提及用半透明白底白字保证可见 */
.chat-row.self .chat-bubble .chat-mention {
  background: rgba(255,255,255,0.22); color: #fff;
}

/* @ 角色选择弹层 */
.mention-picker {
  position: fixed; z-index: 300;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border: 1px solid var(--color-border-light);
  padding: 6px; min-width: 180px; max-height: 50vh; overflow-y: auto;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom left;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.mention-picker.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.mention-picker.closing {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  pointer-events: none;
}
.mention-picker::-webkit-scrollbar { width: 6px; }
.mention-picker::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
.mention-picker-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border: none;
  background: transparent; color: var(--color-text);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--font-size-base); text-align: left;
  transition: background var(--transition-fast);
}
.mention-picker-item:hover { background: var(--color-surface-hover); }
.mention-picker-emoji { font-size: 18px; }

/* 气泡内 Markdown 渲染 */
.chat-bubble.markdown-body {
  padding: 10px 14px;
  background: transparent;
  border: none;
  line-height: 1.5;
}
.chat-bubble.markdown-body > *:first-child { margin-top: 0; }
.chat-bubble.markdown-body > *:last-child { margin-bottom: 0; }
.chat-bubble.markdown-body p { margin: 4px 0; }
.chat-bubble.markdown-body .md-img {
  max-width: 220px;
  border-radius: 8px;
  margin: 4px 0;
  cursor: pointer;
}
/* 单图片消息：不使用气泡容器，图片直接带圆角裁切 */
.chat-bubble-image {
  display: inline-block;
  background: transparent;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  max-width: 60vw;
}
.chat-bubble-image .md-img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 12px;
  margin: 0;
  cursor: pointer;
  object-fit: cover;
}
/* 全屏图片预览 */
.img-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease;
}
.img-preview-overlay.closing { animation: fade-out 0.2s ease forwards; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
.img-preview-img {
  max-width: 95vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.img-preview-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  user-select: none;
}
.img-preview-close:hover { background: rgba(255,255,255,0.3); }
.chat-bubble.markdown-body ul,
.chat-bubble.markdown-body ol {
  margin: 4px 0;
  padding-left: 20px;
}
.chat-bubble.markdown-body blockquote {
  margin: 4px 0;
  padding: 4px 10px;
}

/* 内观首页常驻底部对话条：钉在 Tab 栏正上方，常驻屏幕最下方 */
.insight-chatbar {
  position: fixed; left: 0; right: 0;
  bottom: var(--tab-bar-total);
  z-index: 90;
  margin: 0;
  padding: 10px 16px calc(10px + var(--safe-area-bottom));
  background: var(--color-surface); border-top: 1px solid var(--color-border-light);
  display: flex; align-items: center; gap: 10px; cursor: text;
}
.insight-chatbar-fake {
  flex: 1; padding: 10px 14px; border-radius: var(--radius-full);
  background: var(--color-surface-hover); color: var(--color-text-tertiary);
  font-size: var(--font-size-base);
}

/* 任务页底部速记条：脱离 .page 流，固定钉在 Tab 栏正上方，
   避免 sticky + 负 margin 在普通 block 布局的 .page 中与 Tab 栏之间留出空隙。
   高度变化时同步调整 #task-capture-spacer。 */
#task-capture-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--tab-bar-total);
  z-index: 90;
  margin: 0;
  padding: 10px 16px;
}
#task-capture-spacer { height: 62px; flex: none; }
/* 番茄钟浮动胶囊可见时，给速记条右侧让出位置避免重叠 */
body:has(.capsule-fab:not([hidden])) #task-capture-bar { padding-right: 96px; }

/* ===== 故事配图 ===== */
.story-media {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.story-media img {
  width: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* ===== 回收站 ===== */
.trash-group-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 8px;
}
.trash-group-title { font-size: var(--font-size-md); font-weight: 600; }
.trash-item {
  display: flex; align-items: center; gap: 10px;
}
.trash-item-body { flex: 1; min-width: 0; }
.trash-item-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trash-item-sub { font-size: var(--font-size-xs); color: var(--color-text-tertiary); margin-top: 2px; }
.trash-empty-hint { padding: 40px 16px; text-align: center; color: var(--color-text-tertiary); line-height: 1.9; }

/* ===== 速记历史 ===== */
.log-card .log-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.log-source {
  font-size: 10px; padding: 2px 8px; border-radius: var(--radius-full);
  font-weight: 600;
}
.log-source.app-ai { background: rgba(106,92,255,.14); color: var(--color-primary); }
.log-source.app-note { background: var(--color-surface-hover); color: var(--color-text-secondary); }
.log-source.api { background: rgba(255,149,0,.14); color: var(--color-warning); }
.log-text {
  font-size: var(--font-size-sm); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.log-result {
  margin-top: 8px; padding: 8px 10px;
  background: var(--color-surface-hover); border-radius: var(--radius-sm);
  font-size: var(--font-size-xs); color: var(--color-text-secondary); line-height: 1.6;
  max-height: 120px; overflow: hidden; position: relative;
}
.log-card.is-expanded .log-result,
.log-card.is-expanded .log-text { max-height: none; display: block; -webkit-line-clamp: unset; }
.log-time { font-size: var(--font-size-xs); color: var(--color-text-tertiary); }

/* ===== 速记动作（CRUD）确认卡 ===== */
.cap-action {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  background: var(--color-surface);
}
.cap-action.is-off { opacity: .5; }
.cap-action.is-done { border-color: var(--color-success); }
.cap-action-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cap-action-op {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-full);
}
.cap-op-create { background: rgba(52,199,89,.16); color: var(--color-success); }
.cap-op-query  { background: rgba(59,130,246,.16); color: #3b82f6; }
.cap-op-update { background: rgba(255,149,0,.16); color: var(--color-warning); }
.cap-op-delete { background: rgba(255,59,48,.16); color: var(--color-danger); }
.cap-match {
  margin-top: 6px; font-size: var(--font-size-xs); color: var(--color-text-secondary);
  line-height: 1.7;
}
.cap-match b { color: var(--color-text); font-weight: 600; }
.cap-match-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 4px; border-radius: var(--radius-sm);
}
.cap-match-row.is-off { opacity: .45; }
.cap-match-row .checkbox-circle { margin-top: 2px; flex-shrink: 0; cursor: pointer; }
.cap-action-foot { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.cap-confirm-all-bar {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 0 4px;
}
/* ===== 下拉刷新（Pull-to-Refresh） ===== */
.ptr-indicator {
  width: 100%;
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  background: var(--color-bg);
  flex-shrink: 0;
}
.ptr-inner {
  display: flex; align-items: center; gap: 6px;
  height: var(--ptr-h, 56px);
}
.ptr-arrow {
  display: inline-block;
  transition: transform .2s ease;
  font-size: 12px;
}
.ptr-text { white-space: nowrap; }
.ptr-indicator.is-loading .ptr-arrow {
  width: 14px; height: 14px;
  border: 2px solid var(--color-text-tertiary);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: ptr-spin .8s linear infinite;
  font-size: 0;
}
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ===== 多选操作栏（任务/日记/塔罗等列表复用） ===== */
.select-action-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px;
  /* 抵消 .page 的 16px 内边距，实现贴边效果，同时不产生横向溢出 */
  margin: 16px -16px calc(-16px - var(--safe-area-bottom, 0px));
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  z-index: 5;
}
/* 任务页多选栏：fixed 钉在 Tab 栏正上方，替代速记条 */
#task-select-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--tab-bar-total);
  z-index: 90;
  margin: 0;
  padding: 10px 16px calc(10px + var(--safe-area-bottom));
  animation: selbar-in .25s ease;
}
#task-select-spacer { height: 70px; flex: none; }
@keyframes selbar-in {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes selbar-out {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}
/* 退出多选态：操作栏下滑消失 + 勾选框淡出 */
body.is-exiting-select #task-select-bar,
body.is-exiting-select .select-action-bar {
  animation: selbar-out .25s ease forwards;
}
.select-action-bar .btn { flex: 1; min-width: 0; }
.list-item.is-selected { background: var(--color-bg-selected, rgba(99,102,241,0.08)); }

/* 多选模式过渡：列表项的勾选框淡入 + 标题位移 */
.list-item .checkbox-circle {
  transition: opacity .2s ease, transform .2s ease;
}
body.is-select-mode .list-item .checkbox-circle {
  animation: cb-fadein .22s ease both;
}
@keyframes cb-fadein {
  from { opacity: 0; transform: scale(.6); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes cb-fadeout {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(.6); }
}
body.is-exiting-select .list-item .checkbox-circle {
  animation: cb-fadeout .2s ease forwards;
}
/* 多选模式下，速记条/胶囊等非必要元素隐藏（由任务页 render 控制，此处兜底） */
