/* 功能：定义本地测试台的整体布局；原因：需要在桌面和窄屏下都能清楚对比输入、结果和方案说明。 */
:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #64707d;
  --line: #d9e0e7;
  --accent: #0b6bcb;
  --accent-strong: #084f96;
  --danger: #b42318;
  --ok: #087443;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto;
}

.workbench,
.notes {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workbench {
  padding: 22px;
}

.notes {
  padding: 20px;
  align-self: start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
}

p,
dd,
.field span,
.inputBlock span,
#status {
  color: var(--muted);
}

.topbar p {
  margin-top: 8px;
  font-size: 14px;
}

.badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.controls {
  display: grid;
  /* 功能：为解析、一键下载、清空三个操作保留稳定宽度；原因：按钮增加后避免挤压方式选择框。 */
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.field,
.inputBlock {
  display: grid;
  gap: 7px;
}

select,
textarea,
button {
  font: inherit;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

select {
  height: 40px;
  padding: 0 10px;
}

textarea {
  min-height: 220px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

button {
  height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: #e8edf2;
  color: var(--text);
}

button.secondary:hover {
  background: #dfe6ee;
}

.resultPanel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.resultHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f9fafb;
}

.resultEmpty,
.resultBody {
  padding: 14px;
}

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

.summary {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.candidate {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 10px;
  background: #fff;
}

.candidate code,
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.candidateActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.candidateActions button,
.candidateActions a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  border-radius: 6px;
  padding: 0 10px;
  text-decoration: none;
  font-size: 13px;
}

.candidateActions a {
  background: #eef5ff;
  color: var(--accent-strong);
}

.steps,
.warnings {
  margin-top: 14px;
  padding-left: 18px;
}

.warnings {
  color: #875300;
}

.error {
  color: var(--danger);
}

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

dt {
  font-weight: 700;
  margin-top: 14px;
}

dd {
  margin: 6px 0 0;
  line-height: 1.55;
}

@media (max-width: 860px) {
  /* 功能：窄屏下改成单列；原因：避免说明栏挤压输入框。 */
  .shell {
    grid-template-columns: 1fr;
    width: min(100vw - 20px, 720px);
    margin: 10px auto;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
