/* Text Renderer - 纯文本渲染器样式 */

.wk-file-preview-text-renderer {
  height: 100%;
  overflow: auto;
  padding: var(--wk-sp-4);
  box-sizing: border-box;
  background: var(--wk-bg-base);
}

.wk-file-preview-text-renderer__content {
  font-family: var(
    --wk-font-family-mono,
    ui-monospace,
    SFMono-Regular,
    "SF Mono",
    Menlo,
    Consolas,
    monospace
  );
  font-size: var(--wk-text-size-md);
  line-height: var(--wk-line-height-relaxed, 1.6);
  color: var(--wk-text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

/* Loading state */
.wk-file-preview-text-renderer--loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--wk-sp-3);
  color: var(--wk-text-secondary);
  font-size: var(--wk-text-size-md);
}

.wk-file-preview-text-renderer__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--wk-border-subtle);
  border-top-color: var(--wk-brand-primary);
  border-radius: var(--wk-r-full, 50%);
  animation: wk-text-renderer-spin 0.8s linear infinite;
}

@keyframes wk-text-renderer-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error state */
.wk-file-preview-text-renderer--error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--wk-sp-3);
  color: var(--wk-color-danger);
  font-size: var(--wk-text-size-md);
}

.wk-file-preview-text-renderer__retry {
  padding: var(--wk-sp-2) var(--wk-sp-4);
  border: 1px solid var(--wk-border-default);
  background: var(--wk-bg-base);
  color: var(--wk-text-primary);
  border-radius: var(--wk-r-sm);
  cursor: pointer;
  font-size: var(--wk-text-size-sm);
  transition: background-color 0.15s ease;
}

.wk-file-preview-text-renderer__retry:hover {
  background: var(--wk-bg-hover);
}

.wk-file-preview-text-renderer__retry:active {
  background: var(--wk-bg-active);
}

/* Empty state */
.wk-file-preview-text-renderer--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--wk-text-secondary);
  font-size: var(--wk-text-size-md);
}

/* Dark mode */
body[theme-mode="dark"] .wk-file-preview-text-renderer {
  background: #1a1a1a;
}
