/* ========================================= */
/* 文件：memory-modal.css                      */
/* 功能：星尘回响 / 记忆流卡片浏览及内联编辑区  */
/*       ——磨砂玻璃窗口、记忆卡片流、            */
/*       融合拉手控制台、星星闪烁特效、          */
/*       内联编辑文本框与按钮组                  */
/* ========================================= */

/* 1. 整体窗口：透气水玻璃 + 收紧的极光微发光 (iOS 兼容版) */
.memory-window {
  width: 92%; max-width: 340px; height: 78vh; max-height: 680px;

  /* ✨ 恢复你喜欢的轻薄透气底色，不再刻意压暗 */
  background: linear-gradient(135deg, rgba(15, 12, 25, 0.25), rgba(5, 5, 10, 0.35));

  border: 1px solid rgba(162, 155, 254, 0.2);
  border-radius: 24px;

  /* 修复 iOS 直角发光 Bug 的 3D 渲染魔法 */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);

  /* ✨ 核心调整：大幅收紧发光范围！只有边缘一圈淡淡的光晕 */
  box-shadow:
    -2px -2px 8px rgba(162, 155, 254, 0.25), /* 左上角极其克制的紫光 */
    2px 2px 8px rgba(255, 179, 122, 0.15),   /* 右下角极其克制的橙光 */
    0 8px 20px rgba(0, 0, 0, 0.4),           /* 底部物理投影也缩小范围 */
    inset 0 1px 1px rgba(255, 255, 255, 0.1); /* 内层玻璃高光 */

  /* 保持轻盈的模糊度 */
  backdrop-filter: blur(16px) saturate(110%);
  -webkit-backdrop-filter: blur(16px) saturate(110%);

  display: flex; flex-direction: column;
  position: relative;
}

/* 2. 头部 (保持贴合圆角) */
.memory-header {
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  position: relative; display: flex; justify-content: center; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(90deg, rgba(162, 155, 254, 0.05), rgba(255, 179, 122, 0.03));
}
.memory-title {
  font-size: 17px; font-weight: 700; letter-spacing: 2px;
  background: linear-gradient(90deg, #cbbbf9, #ffb37a);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.memory-close { position: absolute; right: 18px; font-size: 26px; color: rgba(255, 255, 255, 0.4); cursor: pointer; transition: color 0.3s; }
.memory-close:hover { color: rgba(255, 255, 255, 0.8); }

/* 3. 记忆流：存放卡片 */
.memory-stream {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 15px;
  scrollbar-width: none; -ms-overflow-style: none;

  /* ✨ 减震海绵 + 垂直滑动特权：卡片随便滑，绝不扯动底层！ */
  overscroll-behavior-y: none;
  touch-action: pan-y;
}
.memory-stream::-webkit-scrollbar { display: none; }

/* 4. 卡片：极其轻柔的紫橙透明气泡 */
.memory-card-item {
  /* ✨ 核心：极低透明度的紫(0.08)到橙(0.05)渐变，仿佛只有一层颜色的呼吸 */
  background: linear-gradient(135deg, rgba(162, 155, 254, 0.08), rgba(255, 179, 122, 0.05));
  border: 1px solid rgba(162, 155, 254, 0.15); /* 淡淡的紫边 */
  border-radius: 16px; padding: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.memory-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.memory-time { font-size: 11px; color: #cbbbf9; font-weight: 600; letter-spacing: 0.5px; opacity: 0.8; }

/* 紫色发光笔 (稍微调暗了一点光晕) */
.memory-edit-icon {
  width: 18px; height: 18px; cursor: pointer; opacity: 0.6; transition: all 0.3s;
  filter: invert(72%) sepia(35%) saturate(800%) hue-rotate(210deg) brightness(105%) contrast(95%) drop-shadow(0 0 2px rgba(162, 155, 254, 0.4));
}
.memory-edit-icon:hover { opacity: 1; transform: scale(1.1); }
.memory-text { font-size: 13px; color: rgba(255, 255, 255, 0.85); line-height: 1.6; text-align: justify; }

/* 5. 底部游标容器 */
.memory-footer-container {
  display: flex; flex-direction: column;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
}

/* 融合拉手外壳 */
.fusion-handle-wrapper {
  display: flex; justify-content: center; align-items: center;
  padding: 12px 0; cursor: pointer; z-index: 10;
}

/* 融合拉手本体 */
.fusion-handle-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 179, 122, 0.25); /* 极暗的橙色边框 */
  border-radius: 30px;
  box-shadow: inset 0 0 10px rgba(162, 155, 254, 0.1);
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
}
.handle-text {
  background: linear-gradient(90deg, #cbbbf9, #ffb37a);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  opacity: 0.9;
}
.fusion-handle-btn img { width: 14px; filter: invert(0.8); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* 隐藏的参数面板 */
.console-panel {
  max-height: 0; overflow: hidden;
  background: linear-gradient(0deg, rgba(162, 155, 254, 0.08), transparent);
  transition: max-height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.console-content { padding: 5px 25px 25px 25px; }

/* 滑块微调 */
.slider-info { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255, 255, 255, 0.6); margin-bottom: 10px; }
.slider-val { font-weight: bold; }

/* ============ ✨ 星尘回响：星星闪烁动画 ✨ ============ */

/* 1. 定义动画关键帧：缓慢呼吸闪烁 */
@keyframes twinkle-star-slow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1); /* 正常亮度 */
  }
  50% {
    opacity: 0.4; /* 变暗到 40% */
    transform: scale(0.85); /* 微微缩小 */
    filter: brightness(0.8); /* 亮度也降低 */
  }
}

/* 2. 星星基础样式 (修复透明隐身 Bug) */
.memory-star {
  display: inline-block;
  margin: 0 5px;
  animation: twinkle-star-slow 4s ease-in-out infinite;

  /* ✨ 终极修复：强行赋予实体颜色，打破隐身魔咒！ */
  -webkit-text-fill-color: #cbbbf9; /* 左星用星光紫 */
  color: #cbbbf9;
}

/* 3. 右星独立样式 (同步呼吸版) */
.star-right {
  /* ✨ 删除了动画延迟，现在它会和左边的星星同频共振了！ */
  -webkit-text-fill-color: #ffb37a;
  color: #ffb37a;
}

/* 微调标题字间距，配合星星 */
.memory-title {
  letter-spacing: 1px; /* 稍微收紧一点点字间距 */
}
/* ============ ✨ 星尘回响：内联编辑区 UI (极致通透版) ✨ ============ */
.memory-edit-box {
  margin-top: 5px;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* 赛博玻璃输入框：完美伪装成原本的文字！ */
.memory-edit-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.15); /* 极度轻薄的暗底，几乎透明 */
  border: 1px dashed rgba(162, 155, 254, 0.35); /* 淡淡的紫光虚线边框，表示可编辑 */
  border-radius: 12px;

  /* ✨ 核心：完美1:1复制原本文字的排版！ */
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px; line-height: 1.6; text-align: justify;

  padding: 12px; box-sizing: border-box;
  resize: none; outline: none; overflow: hidden; /* 隐藏滚动条，用JS让它自适应高度 */
  font-family: inherit;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s;
}

/* 聚焦时：虚线变成紫橙渐变发光实线 */
.memory-edit-textarea:focus {
  border-style: solid;
  border-color: rgba(255, 179, 122, 0.5);
  box-shadow: 0 0 10px rgba(255, 179, 122, 0.15), inset 0 2px 10px rgba(0,0,0,0.2);
}

/* 动作按钮组：完美的等分与居中对齐 */
.memory-btn-group {
  display: flex;
  gap: 10px; /* 按钮之间的呼吸空隙 */
  margin-top: 12px;
  justify-content: space-between;
}

.memory-btn {
  flex: 1; /* ✨ 核心魔法：让三个按钮强制绝对等宽！ */
  padding: 6px 0; /* 既然等宽了，左右就不需要固定数值了 */
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-align: center; /* 确保文字绝对居中 */
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 确认修改 (极其克制的紫橙透明发光) */
.memory-btn-save {
  background: linear-gradient(90deg, rgba(162, 155, 254, 0.15), rgba(255, 179, 122, 0.15));
  color: #ffb37a;
  border: 1px solid rgba(255, 179, 122, 0.3);
}
.memory-btn-save:hover {
  background: linear-gradient(90deg, rgba(162, 155, 254, 0.25), rgba(255, 179, 122, 0.25));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 179, 122, 0.15);
}

/* 删除记忆 (极其克制的危险红) */
.memory-btn-delete {
  background: rgba(255, 59, 48, 0.08);
  color: rgba(255, 107, 107, 0.9);
  border: 1px solid rgba(255, 59, 48, 0.2);
}
.memory-btn-delete:hover { background: rgba(255, 59, 48, 0.15); transform: translateY(-2px); }

/* 取消按钮 (几乎隐形的空气感) */
.memory-btn-cancel {
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.memory-btn-cancel:hover { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); }
