/* ── 对话记录 · 叙事预览列表（方案 B） ── */

.child-pills .pill--other {
  color: var(--text-secondary);
}

.child-pills .pill--other.active {
  color: var(--brand-on);
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── 左滑删除 ── */

.record-swipe-row {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-md) + 2px);
  isolation: isolate;
}

.record-swipe-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 76px;
  display: flex;
  align-items: stretch;
  z-index: 0;
}

.record-swipe-delete {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: none;
  background: linear-gradient(180deg, #d47552 0%, #b85f3a 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.record-swipe-delete i {
  font-size: 16px;
  opacity: 0.92;
}

.record-swipe-delete:active {
  filter: brightness(0.94);
}

.record-swipe-content {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  border-radius: calc(var(--radius-md) + 2px);
  background: linear-gradient(165deg, #fffdfb 0%, #fff9f3 52%, #fffcf8 100%);
  border: 1px solid rgba(212, 165, 116, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 1px 2px rgba(44, 54, 57, 0.03),
    0 6px 20px rgba(196, 112, 75, 0.05);
  transition: transform 0.28s var(--ease-soft);
  will-change: transform;
}

.record-swipe-row .record-card--narrative {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.record-swipe-row.is-open .record-swipe-content {
  transform: translateX(-76px);
}

.record-swipe-row.is-dragging .record-swipe-content {
  transition: none;
}

.record-swipe-row.record-card--removing {
  opacity: 0;
  transform: scale(0.97) translateY(6px);
  transition:
    opacity 0.28s var(--ease-soft),
    transform 0.28s var(--ease-soft);
  pointer-events: none;
}

@media (hover: hover) {
  .record-swipe-row:hover .record-swipe-content {
    border-color: rgba(212, 165, 116, 0.24);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 1),
      0 2px 4px rgba(44, 54, 57, 0.04),
      0 10px 28px rgba(196, 112, 75, 0.09);
  }

  .record-swipe-row:hover .record-card-chevron {
    color: var(--brand);
    opacity: 1;
  }
}

.record-list .record-card {
  margin-bottom: 0;
}

.record-card--narrative {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: calc(var(--radius-md) + 2px);
  background: linear-gradient(165deg, #fffdfb 0%, #fff9f3 52%, #fffcf8 100%);
  border: 1px solid rgba(212, 165, 116, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 1px 2px rgba(44, 54, 57, 0.03),
    0 6px 20px rgba(196, 112, 75, 0.05);
  transition:
    box-shadow 0.32s var(--ease-soft),
    border-color 0.32s var(--ease-soft),
    opacity 0.28s var(--ease-soft),
    transform 0.28s var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.record-card--narrative.record-card--removing {
  opacity: 0;
  transform: scale(0.97) translateY(6px);
  pointer-events: none;
}

.record-card-atmo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 70% at 100% 0%, rgba(232, 168, 124, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 50% at 0% 100%, rgba(107, 144, 128, 0.05), transparent 50%);
}

.record-card--narrative::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: radial-gradient(rgba(44, 54, 57, 0.04) 0.55px, transparent 0.55px);
  background-size: 5px 5px;
  -webkit-mask-image: linear-gradient(160deg, rgba(0, 0, 0, 0.45) 0%, transparent 68%);
  mask-image: linear-gradient(160deg, rgba(0, 0, 0, 0.45) 0%, transparent 68%);
}

.record-card-inner {
  position: relative;
  z-index: 1;
  padding: 16px 18px 15px;
}

.record-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.record-card-head-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.record-card-when {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.record-card-date {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.record-scene-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.record-scene-trigger:active {
  opacity: 0.78;
}

.record-scene-date,
.record-scene-label {
  overflow-wrap: anywhere;
}

.record-scene-sep {
  opacity: 0.72;
}

.record-scene-chevron {
  flex-shrink: 0;
  font-size: 9px;
  opacity: 0.55;
  transition: transform 0.22s var(--ease-soft);
}

.record-card--scene-open .record-scene-chevron {
  transform: rotate(180deg);
  opacity: 0.85;
  color: var(--brand);
}

.record-scene-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 2px;
}

.record-scene-option {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(212, 165, 116, 0.22);
  background: rgba(255, 252, 248, 0.92);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color 0.18s var(--ease-soft),
    background 0.18s var(--ease-soft),
    color 0.18s var(--ease-soft);
}

.record-scene-option.is-active {
  border-color: rgba(196, 112, 75, 0.42);
  background: var(--worth-bg);
  color: var(--brand-dark);
}

.record-scene-option:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .record-scene-trigger:hover {
    color: var(--text-secondary);
  }

  .record-scene-trigger:hover .record-scene-chevron {
    color: var(--brand);
    opacity: 1;
  }

  .record-scene-option:hover {
    border-color: rgba(196, 112, 75, 0.32);
    color: var(--brand-dark);
  }
}

.record-card-meta {
  font-size: 11px;
  font-family: var(--font-family-data);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  opacity: 0.82;
}

.record-card-body {
  min-width: 0;
}

.record-card-quote {
  margin: 0 0 6px;
  font-family: var(--font-family-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.48;
  letter-spacing: 0.035em;
  color: var(--brand-dark);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.record-card-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.record-card-hint--pending {
  margin-top: 0;
  padding-top: 2px;
  font-family: var(--font-family-display);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  -webkit-line-clamp: 3;
}

.record-card-chevron {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 9px;
  color: var(--text-tertiary);
  opacity: 0.72;
}

.record-card--narrative .status-pill {
  flex-shrink: 0;
  margin-top: 0;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-pill--done {
  background: var(--grow-bg);
  color: var(--grow);
}

.status-pill--processing {
  background: var(--worth-bg);
  color: var(--worth);
}

.status-pill--failed {
  background: var(--notice-bg);
  color: var(--notice);
}

.record-card--processing {
  cursor: default;
}

.record-card--processing .record-card-chevron {
  display: none;
}

@media (hover: hover) {
  .record-card--processing:hover {
    border-color: rgba(44, 54, 57, 0.08);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 1),
      0 2px 4px rgba(44, 54, 57, 0.04),
      0 8px 20px rgba(44, 54, 57, 0.06);
  }
}

.record-card--narrative:active .record-card-inner {
  opacity: 0.92;
}

@media (hover: hover) {
  .record-card--narrative:hover {
    border-color: rgba(212, 165, 116, 0.24);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 1),
      0 2px 4px rgba(44, 54, 57, 0.04),
      0 10px 28px rgba(196, 112, 75, 0.09);
  }

  .record-card--narrative:hover .record-card-chevron {
    color: var(--brand);
    opacity: 1;
  }
}

.record-card-inner.anim-fade-up {
  animation: recordCardIn 0.55s var(--ease-soft) both;
}

@keyframes recordCardIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .record-list {
    width: 100%;
    max-width: 100%;
  }

  .record-card-inner {
    padding: 15px 16px 14px;
  }

  .record-card-quote {
    font-size: 15px;
  }

  .record-card-head-end {
    gap: 6px;
  }

  .record-card--narrative::after {
    opacity: 0.14;
  }
}

@media (prefers-reduced-motion: reduce) {
  .record-card-inner.anim-fade-up {
    animation: none;
  }

  .record-empty.anim-fade-up {
    animation: none;
  }
}

/* ── 空状态 ── */

.record-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(52vh, 420px);
  padding: 8px 4px 24px;
  text-align: center;
}

.record-empty-card {
  width: 100%;
  max-width: 320px;
  padding: 28px 22px 24px;
  border-radius: calc(var(--radius-md) + 4px);
  background: linear-gradient(165deg, #fffdfb 0%, #fff9f3 52%, #fffcf8 100%);
  border: 1px solid rgba(212, 165, 116, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 1px 2px rgba(44, 54, 57, 0.03),
    0 8px 24px rgba(196, 112, 75, 0.06);
}

.record-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: var(--grow);
  background: var(--grow-bg);
}

.record-empty-title {
  margin: 0 0 10px;
  font-family: var(--font-family-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--brand-dark);
}

.record-empty-desc {
  margin: 0 auto;
  max-width: 260px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.record-empty-tips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.record-empty-tips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(212, 165, 116, 0.16);
}

.record-empty-tips i {
  font-size: 11px;
  color: var(--brand);
  opacity: 0.85;
}

.record-empty-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 20px;
}

.record-empty-cta i {
  font-size: 16px;
}

@media (max-width: 768px) {
  .record-empty {
    min-height: min(48vh, 380px);
    padding-top: 4px;
  }

  .record-empty-card {
    padding: 24px 18px 20px;
  }

  .record-empty-title {
    font-size: 19px;
  }

  .record-empty-desc {
    font-size: 13px;
  }
}

/* ── 删除确认 · 底部抽屉 ── */

.record-delete-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.record-delete-sheet:not(.hidden) {
  pointer-events: auto;
}

.record-delete-sheet.hidden {
  display: none;
}

.record-delete-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 54, 57, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.32s var(--ease-soft);
}

.record-delete-sheet:not(.hidden) .record-delete-backdrop {
  opacity: 1;
}

.record-delete-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 8px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #fffdfb 0%, #fff8f1 100%);
  border: 1px solid rgba(212, 165, 116, 0.18);
  border-bottom: none;
  box-shadow:
    0 -8px 40px rgba(196, 112, 75, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.record-delete-sheet:not(.hidden) .record-delete-panel {
  transform: translateY(0);
}

.record-delete-handle {
  width: 36px;
  height: 4px;
  margin: 6px auto 18px;
  border-radius: 999px;
  background: rgba(212, 165, 116, 0.35);
}

.record-delete-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: rgba(196, 112, 75, 0.1);
  color: var(--brand);
  font-size: 20px;
}

.record-delete-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.record-delete-desc {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  color: var(--text-secondary);
}

.record-delete-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.record-delete-cancel,
.record-delete-confirm {
  height: 46px;
  border-radius: calc(var(--radius-md) + 2px);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.22s var(--ease-soft),
    opacity 0.22s var(--ease-soft),
    transform 0.16s var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
}

.record-delete-cancel {
  border: 1px solid rgba(212, 165, 116, 0.28);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
}

.record-delete-cancel:active {
  transform: scale(0.98);
}

.record-delete-confirm {
  border: none;
  background: linear-gradient(145deg, #c4704b 0%, #b85f3a 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(196, 112, 75, 0.28);
}

.record-delete-confirm:active {
  transform: scale(0.98);
}

.record-delete-confirm.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

/* ── 操作反馈 ── */

.record-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  z-index: 130;
  max-width: min(calc(100% - 32px), 320px);
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(44, 54, 57, 0.88);
  color: #fff;
  font-size: 13px;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(44, 54, 57, 0.18);
  animation: recordToastIn 0.32s var(--ease-soft) both;
}

.record-toast.hidden {
  display: none;
}

.record-toast--error {
  background: rgba(180, 72, 58, 0.92);
}

@keyframes recordToastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .record-delete-panel,
  .record-delete-backdrop,
  .record-card--narrative.record-card--removing,
  .record-swipe-row.record-card--removing,
  .record-swipe-content {
    transition: none;
  }

  .record-toast {
    animation: none;
  }
}
