/* ── Reddit 创作台 — Reddit 内容生产工作流专属页 ── */
/* 标准模式：两列布局，rwb- 前缀，复用现 CSS 变量 */

/* ── 顶栏 ── */

.rwb-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.rwb-back-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.rwb-back-btn:hover { background: var(--bg-hover); }
.rwb-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}
.rwb-run-btn {
  background: #ff4500;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.rwb-run-btn:hover { background: #e03d00; }
.rwb-run-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ── 两列布局 ── */

.rwb-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  padding: 16px;
  height: calc(100vh - 60px);
  overflow: hidden;
}
.rwb-left, .rwb-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

/* ── 区块 ── */

.rwb-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.rwb-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

/* ── 按钮 ── */

.rwb-sm-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 4px;
}
.rwb-sm-btn:hover { background: var(--bg-hover); }
.rwb-approve-btn {
  background: #22c55e;
  color: #fff;
  border: none;
  padding: 8px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-right: 8px;
}
.rwb-approve-btn:hover { background: #16a34a; }
.rwb-reject-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 8px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.rwb-reject-btn:hover { background: #dc2626; }

/* ── 选题列表 ── */

.rwb-topic-list { max-height: 260px; overflow-y: auto; }
.rwb-topic-item {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.rwb-topic-item:last-child { border-bottom: none; }
.rwb-topic-item:hover { background: var(--bg-hover); }
.rwb-topic-body { flex: 1; min-width: 0; }
.rwb-topic-title { font-size: 13px; font-weight: 500; line-height: 1.4; }
.rwb-topic-meta { display: flex; gap: 6px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.rwb-source-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #ff4500;
  color: #fff;
}
.rwb-tag {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 3px;
}
.rwb-score { font-size: 12px; font-weight: 700; color: #f59e0b; }
.rwb-topic-reason {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.3;
}
.rwb-topic-actions { min-width: 50px; text-align: right; }

/* ── 帖子设置 ── */

.rwb-settings {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rwb-settings label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.rwb-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-main);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.rwb-input:focus { border-color: #ff4500; outline: none; }

/* ── 步骤状态 ── */

.rwb-steps-list { padding: 10px 14px; }
.rwb-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin: 2px;
  white-space: nowrap;
  line-height: 1.3;
}
.rwb-step-completed { background: #dcfce7; color: #166534; }
.rwb-step-running { background: #dbeafe; color: #1e40af; }
.rwb-step-failed { background: #fee2e2; color: #991b1b; }
.rwb-step-waiting { background: #fff3e0; color: #9a5f00; }
.rwb-step-pending { background: var(--bg-subtle); color: var(--text-dim); }
.rwb-step-icon { font-size: 12px; }

/* ── 编辑器 ── */

.rwb-editor-form {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rwb-title-input {
  font-size: 15px;
  font-weight: 600;
  padding: 10px;
}
.rwb-textarea {
  width: 100%;
  min-height: 250px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-main);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}
.rwb-textarea:focus { border-color: #ff4500; outline: none; }
.rwb-editor-tabs {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.rwb-editor-tab {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.rwb-editor-tab:hover { background: var(--bg-hover); }
.rwb-editor-tab.active {
  background: #ff4500;
  color: #fff;
  border-color: #ff4500;
}
.rwb-preview-area {
  display: none;
  min-height: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.7;
  overflow-y: auto;
}

/* ── 审核区 ── */

.rwb-gate-section { padding: 12px 14px; }
.rwb-gate-header {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.rwb-gate-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.rwb-gate-comment {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-main);
  color: var(--text);
}

/* ── 运行历史 ── */

.rwb-history-list { max-height: 300px; overflow-y: auto; }
.rwb-history-item {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.rwb-history-item:hover { background: var(--bg-hover); }
.rwb-history-item:last-child { border-bottom: none; }
.rwb-history-row { display: flex; justify-content: space-between; align-items: center; }
.rwb-history-time { font-size: 11px; color: var(--text-dim); }
.rwb-history-meta { font-size: 11px; color: var(--text-dim); }
.rwb-history-detail {
  display: none;
  padding: 8px 0 0 0;
  font-size: 12px;
}
.rwb-history-detail.open { display: block; }
.rwb-history-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 12px;
}

/* ── 状态徽章 ── */

.rwb-status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
}
.rwb-status-badge.completed { background: #dcfce7; color: #166534; }
.rwb-status-badge.running { background: #dbeafe; color: #1e40af; }
.rwb-status-badge.failed { background: #fee2e2; color: #991b1b; }
.rwb-status-badge.paused { background: #fff3e0; color: #9a5f00; }
.rwb-status-badge.cancelled { background: var(--bg-subtle); color: var(--text-dim); }

/* ── 通用 ── */

.rwb-loading { padding: 20px; text-align: center; color: var(--text-dim); font-size: 13px; }
.rwb-empty { padding: 20px; text-align: center; color: var(--text-dim); font-size: 13px; }
