/* ═══════════════════════════════════════════════
   Inbox 互动 v1
   ═══════════════════════════════════════════════ */

.ix-module {
  padding: 28px 32px 64px;
  max-width: 860px;
  margin: 0 auto;
  font-family: -apple-system, 'SF Pro Text', 'PingFang SC', sans-serif;
}

/* ── Header ── */
.ix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}
.ix-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  margin: 0 0 3px;
  letter-spacing: -0.02em;
}
.ix-subtitle {
  font-size: 11px;
  color: var(--color-text-muted, #94a3b8);
  margin: 0;
}
.ix-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon button */
.ix-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-background, #fff);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.ix-icon-btn:hover {
  background: var(--color-surface, #f8fafc);
  color: var(--color-text, #0f172a);
  border-color: #cbd5e1;
}

/* Import trigger button */
.ix-import-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 32px;
  border: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-background, #fff);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.ix-import-trigger:hover {
  background: var(--color-surface, #f8fafc);
  color: var(--color-text, #0f172a);
  border-color: #cbd5e1;
}

/* ── Toolbar: tabs + filters on one row ── */
.ix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  margin-bottom: 16px;
  gap: 12px;
}

.ix-tabs {
  display: flex;
  gap: 0;
  flex-shrink: 0;
}
.ix-tab {
  padding: 10px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary, #64748b);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  white-space: nowrap;
}
.ix-tab:hover { color: var(--color-text, #0f172a); }
.ix-tab-active {
  color: var(--color-primary, #0ea5e9);
  border-bottom-color: var(--color-primary, #0ea5e9);
  font-weight: 600;
}
.ix-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  background: var(--color-primary, #0ea5e9);
  color: #fff;
  border-radius: 8px;
  transition: opacity 0.15s;
}
.ix-badge:empty { display: none; }

.ix-filters {
  display: flex;
  gap: 8px;
  padding-bottom: 1px;
}
.ix-select {
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
  font-family: inherit;
  color: var(--color-text-secondary, #64748b);
  background: var(--color-surface, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.ix-select:focus { border-color: var(--color-primary, #0ea5e9); }

/* ── Body states ── */
.ix-loading, .ix-empty, .ix-error {
  text-align: center;
  padding: 48px 24px;
  font-size: 13px;
  color: var(--color-text-muted, #94a3b8);
}
.ix-error { color: #ef4444; }

/* ── Comment Card ── */
.ix-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ix-card {
  background: var(--color-background, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-left: 3px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px 10px;
  transition: box-shadow 0.15s;
}
.ix-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.05); }

.ix-s-positive { border-left-color: #10b981; }
.ix-s-neutral  { border-left-color: #94a3b8; }
.ix-s-negative { border-left-color: #ef4444; }
.ix-pinned     { background: #fffdf5; }

/* Card meta row */
.ix-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}
.ix-sent-dot {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}
.ix-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
}
.ix-plat-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--plat-color, #64748b);
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.ix-brand-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary, #64748b);
  background: var(--color-surface-2, #f1f5f9);
  border-radius: 4px;
}
.ix-ts {
  margin-left: auto;
  font-size: 10px;
  color: var(--color-text-muted, #94a3b8);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Comment text */
.ix-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text, #0f172a);
  margin: 0 0 8px;
  word-break: break-word;
}

/* Replied bubble */
.ix-replied-bubble {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
  padding: 7px 10px;
  background: #f0fdf4;
  border-left: 2px solid #10b981;
  border-radius: 6px;
  font-size: 12px;
  color: #166534;
}
.ix-replied-icon { font-size: 11px; flex-shrink: 0; }
.ix-replied-bubble time { margin-left: auto; font-size: 10px; color: #6ee7b7; white-space: nowrap; }

/* Card footer */
.ix-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ix-post-ref {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-muted, #94a3b8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
  flex-shrink: 1;
}
.ix-post-ref svg { flex-shrink: 0; opacity: 0.6; }

.ix-card-actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.ix-act-btn {
  padding: 3px 9px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  color: var(--color-text-secondary, #64748b);
  background: none;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.ix-act-btn:hover {
  background: var(--color-surface-2, #f1f5f9);
  color: var(--color-text, #0f172a);
}
.ix-act-btn.active { color: #f59e0b; }

/* Reply form */
.ix-reply-form {
  margin-top: 8px;
  padding: 10px;
  background: var(--color-surface, #f8fafc);
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e8f0);
}
.ix-reply-form textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  min-height: 60px;
  color: var(--color-text, #0f172a);
  background: var(--color-background, #fff);
}
.ix-reply-form textarea:focus {
  outline: none;
  border-color: var(--color-primary, #0ea5e9);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.ix-reply-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 7px;
}

/* Shared button primitives */
.ix-btn-primary {
  padding: 0 16px;
  height: 34px;
  background: var(--color-primary, #0ea5e9);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.ix-btn-primary:hover   { opacity: 0.88; }
.ix-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.ix-btn-primary.ix-btn-sm { height: 28px; font-size: 12px; padding: 0 12px; }

.ix-btn-ghost {
  padding: 0 14px;
  height: 34px;
  background: none;
  color: var(--color-text-secondary, #64748b);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.ix-btn-ghost:hover { background: var(--color-surface, #f8fafc); color: var(--color-text, #0f172a); }
.ix-btn-ghost.ix-btn-sm { height: 28px; font-size: 12px; padding: 0 10px; }

/* ── Import Modal ── */
.ix-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.35);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ix-modal {
  background: var(--color-background, #fff);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
}
.ix-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}
.ix-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}
.ix-modal-desc {
  font-size: 13px;
  color: var(--color-text-secondary, #64748b);
  line-height: 1.6;
  margin: 10px 20px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.ix-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
}

/* Import result inside modal */
.ix-import-result {
  padding: 0 20px 16px;
}
.ix-imp-summary {
  font-size: 13px;
  color: var(--color-text, #0f172a);
  padding: 12px 0 8px;
  border-top: 1px solid var(--color-border, #e2e8f0);
}
.ix-imp-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}
.ix-imp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.ix-imp-handle {
  color: var(--color-text, #0f172a);
  font-weight: 500;
}
.ix-imp-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-muted, #94a3b8);
  font-weight: 500;
}
.ix-imp-count.has-new { color: #10b981; }
.ix-imp-err {
  flex-basis: 100%;
  font-size: 11px;
  color: #ef4444;
  line-height: 1.4;
  padding-left: 2px;
}
