* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #1d1d1d;
  --muted: #6a6a6a;
  --border: #d9d9d9;
  --accent: #3a3a3a;
  --ai: #9a4a4a;
  --human: #4b7a4b;
}

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Tahoma, sans-serif;
  font-size: 12px;
  color: var(--text);
  background: #e9e9e9;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.page {
  width: 1100px;
  height: 650px;
  margin: 0;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.header {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  height: calc(100% - 22px);
}

.column {
  padding: 6px 8px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.column-title {
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--muted);
  margin-bottom: 6px;
}

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

.row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px;
  align-items: center;
}

label {
  color: var(--muted);
}

select,
input[type="file"],
textarea {
  width: 100%;
  font-size: 12px;
  padding: 3px 5px;
  border: 1px solid var(--border);
  background: #fff;
}

textarea {
  resize: none;
  min-height: 72px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.notice {
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 4px;
}

.primary {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #2a2a2a;
  background: #1d1d1d;
  color: #fff;
  cursor: pointer;
}

.primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.loading {
  font-size: 11px;
  color: var(--muted);
  display: none;
  align-items: center;
  gap: 4px;
}

.loading.is-active {
  display: inline-flex;
}

.loading-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.25;
  animation: loading-pulse 0.9s infinite ease-in-out;
}

.loading-dot:nth-of-type(2) {
  animation-delay: 0.15s;
}

.loading-dot:nth-of-type(3) {
  animation-delay: 0.3s;
}

.loading-bar {
  width: 60px;
  height: 3px;
  border-radius: 999px;
  background: #efefef;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-left: 6px;
}

.loading-bar-fill {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--accent);
  animation: loading-bar 1.2s infinite ease-in-out;
}

@keyframes loading-pulse {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes loading-bar {
  0% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(160%);
  }
}

.error {
  font-size: 11px;
  color: var(--ai);
  min-height: 14px;
}

.warning {
  font-size: 11px;
  color: #8a6d1d;
  margin-top: 4px;
  display: none;
}

.warning.is-active {
  display: block;
}

.output {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.output-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px;
}

.label {
  color: var(--muted);
}

.value {
  color: var(--text);
}

.value.muted {
  color: var(--muted);
}

.status-ai {
  color: var(--ai);
}

.status-human {
  color: var(--human);
}

.meter {
  height: 4px;
  background: #efefef;
  border: 1px solid var(--border);
  margin-top: 3px;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.details {
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 6px;
}

.details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 11px;
}

.raw {
  margin: 4px 0 0;
  padding: 4px 6px;
  background: #fafafa;
  border: 1px solid var(--border);
  font-size: 11px;
  white-space: pre-wrap;
}
