:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #2f6feb;
  --accent-soft: #eaf1fe;
  --ok: #1f7a4d;
  --ok-soft: #eef8f2;
  --bad: #a02020;
  --bad-soft: #fdf2f2;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono",
    monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.page-head p {
  margin: 0;
  max-width: 84ch;
  color: var(--muted);
}

.page-head strong {
  color: var(--text);
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eceff4;
  font-family: var(--mono);
  font-size: 0.9em;
}

.panes {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

@media (max-width: 940px) {
  .panes {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}

.pane-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* 拖拽区 */
.dropzone {
  margin: 14px;
  padding: 26px 18px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: #fbfcfd;
  text-align: center;
  transition: border-color 0.12s, background 0.12s;
}

.dropzone-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-hint p {
  margin: 0 0 4px;
  color: var(--muted);
}

.dropzone-big {
  font-size: 15px;
  font-weight: 600;
  color: var(--text) !important;
}

.dropzone-small {
  font-size: 12px;
  margin-top: 8px !important;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* 预览区 */
.preview {
  flex: 1;
  min-height: 240px;
  overflow: auto;
  padding: 0 14px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview svg {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* 状态 */
.status {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.status-error {
  color: var(--bad);
}

/* 报告区 */
.report {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.report .empty {
  margin: 0;
  color: var(--muted);
}

.report-head {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
}

.stat-name {
  flex: 0 0 5.5em;
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
}

.stat-unit {
  color: var(--muted);
  font-size: 12px;
}

/* 校验结论 */
.findings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
}

.finding-mark {
  flex: 0 0 auto;
  font-weight: 700;
}

.finding-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.finding-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.verdict {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
}

.verdict-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.verdict-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.page-foot {
  color: var(--muted);
  font-size: 12.5px;
}

/* 报告末尾的补充说明 */
.report-note {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--muted);
  background: #f4f6f8;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 预览区里的错误提示 */
.preview-error {
  margin: 0;
  color: var(--bad);
  font-size: 13px;
}

/* 修复按钮 */
.fix-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.fix-actions button {
  padding: 9px 22px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.fix-actions button:hover:not(:disabled) {
  filter: brightness(1.08);
}

.fix-actions button:active:not(:disabled) {
  transform: translateY(1px);
}

.fix-actions button:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* 修复结果 */
.fix-title {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 8px;
}

.fix-line {
  color: var(--muted);
  font-size: 13px;
  padding: 2px 0;
}

/* 修复前后对照 */
.compare {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 14px;
}

.compare-item {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.compare-label {
  display: block;
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 3px;
}

.compare-value {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.compare-before {
  background: var(--bad-soft);
  color: var(--bad);
}

.compare-after {
  background: var(--ok-soft);
  color: var(--ok);
}

.compare-arrow {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 18px;
}

.threshold-setting { padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.threshold-setting input { width: 90px; padding: 4px 6px; font: inherit; }
.threshold-setting small { color: var(--muted); }
