/* ============================================================
 * 灵音托管引擎自动化工作台 - 剪贴板历史组件 (comp-clipboard-history.css)
 * 挂载点：#mount-clipboard-history（由 LWM 窗口提供容器）
 * ============================================================ */

/* ===== 剪贴板历史根容器 ===== */
.clipboard-history-root {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 1;
  pointer-events: auto;
  background: var(--bg-secondary, var(--bg-secondary));
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
}

/* ===== 头部 ===== */
.ch-header {
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.08);
  border-bottom: 1px solid var(--border-color, #1e3a5f);
  flex-shrink: 0;
}

.ch-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ch-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e0e8f5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ch-actions {
  display: flex;
  gap: 6px;
}

.ch-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #1e3a5f);
  background: transparent;
  color: var(--text-muted, #5a7a9e);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ch-icon-btn:hover {
  color: var(--accent-cyan, #06b6d4);
  border-color: var(--accent-cyan, #06b6d4);
}

.ch-icon-btn.danger:hover {
  color: #ef4444;
  border-color: #ef4444;
}

.ch-close-btn:hover {
  color: #f87171 !important;
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
}

/* ===== 搜索栏 ===== */
.ch-search-row {
  margin-bottom: 8px;
}

.ch-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ch-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted, #5a7a9e);
  font-size: 12px;
  pointer-events: none;
}

.ch-search-input {
  width: 100%;
  padding: 6px 10px 6px 30px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #1e3a5f);
  background: var(--bg-primary, var(--bg-primary));
  color: var(--text-primary, #e0e8f5);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.ch-search-input:focus {
  border-color: var(--accent-cyan, #06b6d4);
}

.ch-search-input::placeholder {
  color: var(--text-muted, #5a7a9e);
}

/* ===== 设置行 ===== */
.ch-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ch-setting-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ch-setting-label {
  font-size: 11px;
  color: var(--text-muted, #5a7a9e);
}

.ch-number-input {
  width: 60px;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color, #1e3a5f);
  background: var(--bg-primary, var(--bg-primary));
  color: var(--text-primary, #e0e8f5);
  font-size: 12px;
  outline: none;
}

.ch-hint {
  font-size: 11px;
  color: #f59e0b;
}

/* ===== 主体列表 ===== */
.ch-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.ch-body::-webkit-scrollbar {
  width: 3px;
}

.ch-body::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 3px;
}

.ch-empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted, #5a7a9e);
  font-size: 13px;
}

.ch-empty i {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.5;
}

.ch-empty-hint {
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.7;
}

.ch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-card, #152244);
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.ch-item:hover {
  border-color: var(--border-color, #1e3a5f);
}

.ch-item-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.ch-item-text {
  font-size: 12px;
  color: var(--text-primary, #e0e8f5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.ch-item-time {
  font-size: 10px;
  color: var(--text-muted, #5a7a9e);
  display: flex;
  align-items: center;
  gap: 3px;
}

.ch-item-date {
  font-size: 10px;
  color: var(--text-muted, #5a7a9e);
  opacity: 0.7;
}

.ch-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.ch-item-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted, #5a7a9e);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ch-item-btn:hover {
  color: var(--accent-cyan, #06b6d4);
  background: rgba(6, 182, 212, 0.1);
}

.ch-item-btn.danger:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ===== 底部 ===== */
.ch-footer {
  padding: 6px 14px;
  border-top: 1px solid var(--border-color, #1e3a5f);
  background: rgba(59, 130, 246, 0.04);
  flex-shrink: 0;
}

.ch-count {
  font-size: 11px;
  color: var(--text-muted, #5a7a9e);
}


/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .ch-header { padding: 8px 10px; }
  .ch-title { font-size: 13px; }
  .ch-settings-row { flex-direction: column; gap: 6px; align-items: flex-start; }
  .ch-body { padding: 6px; }
  .ch-item { padding: 6px 8px; gap: 6px; }
  .ch-item-text { font-size: 11px; }
  .ch-item-actions { gap: 2px; }
  .ch-item-btn { width: 20px; height: 20px; font-size: 10px; }
  .ch-footer { padding: 4px 10px; }
}
