/* ============================================
   INBOX - 收件箱专有样式
   （布局、工具栏、筛选栏、详情面板等共用 logs 样式，
    此文件仅保留 inbox 独有的元素样式）
   ============================================ */

/* ====== 筛选栏搜索框 ====== */
.inbox-search-wrap {
  position: relative;
  flex: 1;
  max-width: 240px;
  margin-left: auto;
}

.inbox-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.inbox-search-input {
  width: 100%;
  padding: 6px 10px 6px 30px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 12.5px;
  font-family: var(--font-sans);
  background: var(--bg-white);
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

.inbox-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.12);
}

/* ====== 邮件列表项（卡片式，与 logs 一致） ====== */
.inbox-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
  display: flex;
  gap: 12px;
}

.inbox-item:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.inbox-item.active {
  background: var(--primary-subtle);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-sm);
}

/* 未读状态：左侧主色细条 */
.inbox-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--primary);
}

/* 未读指示点 */
.inbox-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
  align-self: flex-start;
}

.inbox-item:not(.unread) .inbox-item-dot {
  background: transparent;
}

.inbox-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inbox-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inbox-item-from {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  letter-spacing: -0.01em;
}

.inbox-item:not(.unread) .inbox-item-from {
  font-weight: 500;
  color: var(--text-secondary);
}

.inbox-item-time {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

.inbox-item-subject {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.inbox-item:not(.unread) .inbox-item-subject {
  color: var(--text-secondary);
  font-weight: 400;
}

.inbox-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.inbox-item-account {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--gray-100);
  padding: 1px 7px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.inbox-item-attach-icon {
  width: 13px;
  height: 13px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ====== 详情面板顶部操作按钮区 ====== */
.inbox-detail-header {
  margin-bottom: 28px;
}

.inbox-detail-actions-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.inbox-detail-actions-right {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ====== 附件列表（详情面板内） ====== */
.inbox-attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.inbox-attachment-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.inbox-attachment-info {
  flex: 1;
  min-width: 0;
}

.inbox-attachment-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-attachment-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ====== 同步设置模态框：开关 ====== */
.inbox-switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inbox-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.inbox-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.inbox-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gray-300);
  border-radius: 24px;
  transition: background 200ms ease-out;
}

.inbox-switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 200ms ease-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.inbox-switch input:checked + .inbox-switch-slider {
  background: var(--primary);
}

.inbox-switch input:checked + .inbox-switch-slider::before {
  transform: translateX(20px);
}

.inbox-switch-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ====== 同步状态信息 ====== */
.inbox-sync-info {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.inbox-sync-info.success {
  color: #16a34a;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.inbox-sync-info.failed {
  color: var(--danger, #ef4444);
  background: #fef2f2;
  border-color: #fecaca;
}

/* ====== 已配置 IMAP 账号列表 ====== */
.inbox-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inbox-account-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  font-size: 13px;
}

.inbox-account-item svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
  flex-shrink: 0;
}

.inbox-account-name {
  font-weight: 500;
  color: var(--text);
}

.inbox-account-email {
  color: var(--text-tertiary);
  font-size: 12px;
}

.inbox-accounts-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 12px;
  text-align: center;
  background: var(--gray-50);
  border-radius: 8px;
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .inbox-detail-actions-top {
    margin-bottom: 14px;
  }

  .inbox-detail-actions-right {
    gap: 4px;
  }

  /* 移动端隐藏操作按钮文字，只保留图标（与 logs 一致） */
  .inbox-detail-actions-right .logs-action-btn:not(.icon-only) span {
    display: none;
  }

  .inbox-detail-actions-right .logs-action-btn:not(.icon-only) {
    width: 32px;
    padding: 0;
  }

  .inbox-detail-actions-right .logs-action-btn#inboxBackBtn span {
    display: none;
  }

  .inbox-detail-actions-right .logs-action-btn#inboxBackBtn {
    width: 32px;
    padding: 0;
  }

  /* 返回按钮也只显示图标 */
  .inbox-detail-actions-top .logs-action-btn#inboxBackBtn span {
    display: none;
  }

  .inbox-detail-actions-top .logs-action-btn#inboxBackBtn {
    width: 32px;
    padding: 0;
  }

  /* 筛选栏搜索框 */
  .logs-filter-bar {
    flex-wrap: wrap;
  }

  .inbox-search-wrap {
    max-width: none;
    width: 100%;
    margin-left: 0;
  }
}
