:root {
  --ink: #1f2328;
  --muted: #6b7280;
  --bg: #f4f6f3;
  --panel: #ffffff;
  --line: #dfe5dc;
  --line-strong: #b8c5ba;
  --accent: #155f49;
  --accent-dark: #0f4636;
  --accent-soft: #e6f0eb;
  --danger: #b42318;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "SimSun", "Songti SC", "Noto Serif CJK SC", serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.site-header { background: var(--accent); color: #fff; padding: 28px 0 24px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 6px; color: #cde0d8; font-size: 13px; letter-spacing: 0; }
.site-header h1 { margin: 0; font-size: 27px; line-height: 1.2; }
.tagline { margin: 8px 0 0; color: #e4eee9; max-width: 700px; font-size: 15px; }

.app-shell { padding-top: 22px; padding-bottom: 36px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 19px; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.field { margin-bottom: 15px; }
.field.compact { margin-bottom: 18px; }
.field > label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.req { color: var(--danger); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px 11px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }

.seg { display: inline-flex; gap: 4px; padding: 4px; background: #eef2ec; border: 1px solid var(--line); border-radius: 8px; }
.seg-btn {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 16px;
}
.seg-btn.active { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.time-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.time-item label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 13px; font-weight: 700; }

.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.primary, .ghost {
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 18px;
}
.primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-dark); }
.primary:disabled, .ghost:disabled { opacity: .55; cursor: default; }
.ghost { border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
.hint { min-height: 1em; margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.hint.error { color: var(--danger); }

.result-head { align-items: center; }
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}
.preview-card.full { grid-column: 1 / -1; }
.preview-card h3 { margin: 0 0 10px; font-size: 15px; color: var(--accent); }
.kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 7px 10px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; white-space: pre-wrap; }
.process-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.process-table th, .process-table td { border: 1px solid var(--line-strong); padding: 8px; vertical-align: top; }
.process-table th { background: var(--accent-soft); color: var(--accent-dark); text-align: left; }
.json-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.json-box summary { color: var(--accent); cursor: pointer; font-weight: 700; }
#jsonPreview { overflow: auto; max-height: 320px; background: #f7f8f6; border: 1px solid var(--line); border-radius: 6px; padding: 12px; font-size: 12px; }
.site-footer { color: var(--muted); font-size: 13px; padding-bottom: 30px; }

@media (max-width: 760px) {
  .grid.two, .time-list, .preview-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .section-head { display: block; }
  .result-head .primary { margin-top: 12px; }
  .kv { grid-template-columns: 92px minmax(0, 1fr); }
}
