/* ========================================
   Inner Voice (心声) - 心理活动抽屉
   底部抽屉式弹层，展示角色内心碎片化想法
   风格：安静、克制、毛玻璃、内敛

   ─── 类名结构 ───
   .inner-voice-mask         半透明遮罩
   .inner-voice-drawer       底部抽屉容器
   .inner-voice-handle       顶部拖拽条
   .inner-voice-header       角色信息区
   .inner-voice-list         心声列表
   .inner-voice-item         单条心声
   .inner-voice-actions      底部操作区
   ======================================== */

/* ── CSS 变量 ── */
:root {
  --voice-bg: rgba(255, 255, 255, 0.78);
  --voice-card-bg: rgba(255, 255, 255, 0.55);
  --voice-text-main: #222;
  --voice-text-sub: #888;
  --voice-border: rgba(0, 0, 0, 0.05);
}

/* ================================================
   1. 遮罩层
   ================================================ */
.inner-voice-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.inner-voice-mask.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ================================================
   2. 抽屉容器
   ================================================ */
.inner-voice-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 78%;
  z-index: 201;
  background: var(--voice-bg);
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
}

.inner-voice-drawer.is-active {
  transform: translateY(0);
  pointer-events: auto;
}

/* ================================================
   3. 顶部拖拽条
   ================================================ */
.inner-voice-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 4px;
  flex-shrink: 0;
}

.inner-voice-handle__bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.12);
}

/* ================================================
   4. 角色信息区
   ================================================ */
.inner-voice-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px 12px;
  flex-shrink: 0;
}

.inner-voice-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inner-voice-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.inner-voice-avatar__placeholder {
  font-size: 18px;
  font-weight: 600;
  color: #999;
}

.inner-voice-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.inner-voice-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--voice-text-main);
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.inner-voice-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 11px;
  color: var(--voice-text-sub);
  font-weight: 400;
  letter-spacing: 0.3px;
  width: fit-content;
}

.inner-voice-status__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
}

/* ================================================
   5. 分隔线
   ================================================ */
.inner-voice-divider {
  height: 1px;
  margin: 0 20px;
  background: var(--voice-border);
  flex-shrink: 0;
}

/* ================================================
   6. 心声列表
   ================================================ */
.inner-voice-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.inner-voice-list::-webkit-scrollbar {
  width: 0;
  display: none;
}

/* ================================================
   7. 单条心声
   ================================================ */
.inner-voice-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: var(--voice-card-bg);
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  opacity: 0;
  transform: translateY(8px);
  animation: innerVoiceFadeIn 0.4s ease-out forwards;
}

.inner-voice-item:nth-child(1) { animation-delay: 0.08s; }
.inner-voice-item:nth-child(2) { animation-delay: 0.16s; }
.inner-voice-item:nth-child(3) { animation-delay: 0.24s; }
.inner-voice-item:nth-child(4) { animation-delay: 0.32s; }
.inner-voice-item:nth-child(5) { animation-delay: 0.40s; }
.inner-voice-item:nth-child(6) { animation-delay: 0.48s; }

@keyframes innerVoiceFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inner-voice-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--voice-text-main);
  letter-spacing: 0.3px;
  font-weight: 400;
}

.inner-voice-time {
  font-size: 10px;
  color: var(--voice-text-sub);
  font-weight: 300;
  letter-spacing: 0.2px;
  opacity: 0.7;
}

/* ================================================
   8. 底部操作区
   ================================================ */
.inner-voice-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px 16px;
  padding-bottom: calc(16px + var(--safe-area-bottom, 0px));
  flex-shrink: 0;
  border-top: 1px solid var(--voice-border);
}

.inner-voice-btn {
  height: 38px;
  padding: 0 22px;
  border: none;
  border-radius: 19px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  letter-spacing: 0.2px;
}

.inner-voice-btn:active {
  transform: scale(0.95);
}

.inner-voice-btn--secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--voice-text-main);
}

.inner-voice-btn--secondary:hover {
  background: rgba(0, 0, 0, 0.08);
}

.inner-voice-btn--close {
  background: var(--voice-text-main);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.inner-voice-btn--close:hover {
  opacity: 0.9;
}

/* ================================================
   9. Tab 切换栏
   ================================================ */
.inner-voice-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 20px 4px;
  flex-shrink: 0;
}

.inner-voice-tab {
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.04);
  color: var(--voice-text-sub);
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.inner-voice-tab.is-active {
  background: var(--voice-text-main);
  color: #fff;
}

/* ================================================
   10. 空状态
   ================================================ */
.inner-voice-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  font-size: 13px;
  color: var(--voice-text-sub);
  opacity: 0.7;
}

/* ================================================
   11. 历史心声
   ================================================ */
.inner-voice-history-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--voice-card-bg);
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  margin-bottom: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.inner-voice-history-group--latest {
  border-left: 3px solid rgba(0, 0, 0, 0.12);
}

.inner-voice-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.inner-voice-history-time {
  font-size: 11px;
  color: var(--voice-text-sub);
  font-weight: 400;
}

.inner-voice-history-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--voice-text-sub);
}

.inner-voice-history-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inner-voice-history-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--voice-text-main);
  opacity: 0.85;
  letter-spacing: 0.2px;
}

/* ================================================
   12. 管理按钮 & 多选删除
   ================================================ */
.inner-voice-tab-action {
  margin-left: auto;
  height: 26px;
  padding: 0 12px;
  border: none;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.04);
  color: var(--voice-text-sub);
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.inner-voice-tab-action:active {
  background: rgba(0, 0, 0, 0.08);
}

.inner-voice-history-content {
  flex: 1;
  min-width: 0;
}

/* 选中状态 */
.inner-voice-history-group.is-selected {
  background: rgba(255, 59, 48, 0.06);
  border-color: rgba(255, 59, 48, 0.15);
}

/* 自定义 checkbox */
.inner-voice-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  cursor: pointer;
  position: relative;
}

.inner-voice-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.inner-voice-checkbox__mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inner-voice-checkbox input:checked + .inner-voice-checkbox__mark {
  border-color: #ff3b30;
  background: #ff3b30;
}

.inner-voice-checkbox input:checked + .inner-voice-checkbox__mark::after {
  content: '';
  width: 6px;
  height: 3px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translateY(-0.5px);
}

/* 删除按钮 */
.inner-voice-btn--delete {
  background: #ff3b30;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.2);
}

.inner-voice-btn--delete:hover {
  background: #e0342b;
}

/* ================================================
   13. 展开/收起按钮
   ================================================ */
.inner-voice-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  margin-top: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px dashed rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.inner-voice-expand-btn:active {
  transform: scale(0.97);
  background: rgba(0, 0, 0, 0.06);
}

.inner-voice-expand-btn__text {
  font-size: 12px;
  color: var(--voice-text-sub);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.inner-voice-expand-btn__icon {
  font-size: 10px;
  color: var(--voice-text-sub);
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.inner-voice-expand-btn--collapse {
  background: rgba(0, 0, 0, 0.02);
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.04);
}

.inner-voice-expand-btn--collapse .inner-voice-expand-btn__text {
  color: var(--voice-text-sub);
  opacity: 0.8;
}
