:root {
  --bg: #f4efe7;
  --panel: rgba(255, 252, 247, 0.94);
  --ink: #1d1a16;
  --muted: #5c554c;
  --accent: #1c6e5f;
  --accent-2: #d68229;
  --border: rgba(29, 26, 22, 0.12);
  --shadow: 0 18px 40px rgba(29, 26, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(214, 130, 41, 0.18), transparent 30%),
    linear-gradient(145deg, #f8f3eb 0%, #efe6d9 48%, #f3efe7 100%);
}

.layout {
  width: min(1080px, calc(100% - 32px));
  margin: 24px auto 40px;
  display: grid;
  gap: 18px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  background:
    linear-gradient(135deg, rgba(28, 110, 95, 0.08), rgba(214, 130, 41, 0.12)),
    var(--panel);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2 {
  margin: 0 0 12px;
}

.lead,
.meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.meta {
  margin-top: 12px;
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field.wide {
  grid-column: 1 / -1;
}

.field span,
.field-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
select,
textarea,
button,
.readonly {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
}

input,
select,
textarea,
.readonly {
  min-height: 48px;
  padding: 12px 14px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.6;
}

button {
  min-height: 48px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(28, 110, 95, 0.42);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.actions button {
  flex: 1 1 220px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.checkbox-field {
  align-content: start;
}

.checkbox-card {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.readonly {
  display: flex;
  align-items: center;
  min-height: 52px;
}

/* ========== 帮助提示框 ========== */
.help-box {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(28, 110, 95, 0.2);
  background: rgba(28, 110, 95, 0.05);
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.help-box p {
  margin: 0 0 6px;
}

.help-box p:last-child {
  margin-bottom: 0;
}

.help-box strong {
  color: var(--accent);
}

.help-box code {
  font-size: 0.92em;
  background: rgba(28, 110, 95, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ========== 字段提示 ========== */
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}

/* ========== 状态解释框 ========== */
.explanation-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(214, 130, 41, 0.25);
  background: rgba(214, 130, 41, 0.06);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.explanation-box p {
  margin: 0 0 4px;
}

.explanation-box p:last-child {
  margin-bottom: 0;
}

.explanation-box .explanation-summary {
  font-weight: 700;
  color: var(--accent);
}

.explanation-box .explanation-detail {
  font-size: 13px;
  color: var(--muted);
}

.explanation-box.error {
  border-color: rgba(200, 50, 50, 0.35);
  background: rgba(200, 50, 50, 0.06);
}

.explanation-box.error .explanation-summary {
  color: #c83232;
}

/* ========== 日志输出（黑框） ========== */
.log-output {
  min-height: 240px;
  max-height: 480px;
  margin: 14px 0 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
  border-radius: 16px;
  border: 1px solid rgba(28, 110, 95, 0.12);
  background: #111613;
  color: #dce7de;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

/* 自定义滚动条样式（WebKit 浏览器） */
.log-output::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.log-output::-webkit-scrollbar-track {
  background: rgba(220, 231, 222, 0.05);
  border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb {
  background: rgba(220, 231, 222, 0.25);
  border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb:hover {
  background: rgba(220, 231, 222, 0.4);
}

/* Firefox 滚动条样式 */
.log-output {
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 231, 222, 0.25) rgba(220, 231, 222, 0.05);
}

code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.94em;
}

@media (max-width: 720px) {
  .layout {
    width: min(100%, calc(100% - 20px));
    margin-top: 16px;
  }

  .panel {
    padding: 18px;
  }

  .two-up {
    grid-template-columns: 1fr;
  }
}