* {
  box-sizing: border-box;
}
.review-banner {
  background: var(--gold);
  color: var(--ink);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 6px 12px;
}
[hidden] {
  display: none !important;
}
:root {
  --ink: #19372c;
  --green: #214c3e;
  --light: #f5f6f0;
  --sub: #566a5f;
  --rule: #dce2d7;
  --gold: #e4c76f;
  --serif:
    "Noto Serif CJK SC", "Songti SC", "STSong", "Source Han Serif SC", serif;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: #f6f7f2;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a {
  color: var(--green);
  text-underline-offset: 4px;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ba9033;
  outline-offset: 3px;
}
header {
  background: #fff;
  border-bottom: 1px solid var(--rule);
}
.bar,
.frame,
footer {
  max-width: 1256px;
  margin: auto;
  padding: 0 42px;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.brand b {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.05em;
}
.brandmark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 38px;
  border-radius: 7px 1px 7px 1px;
  background: var(--green);
  color: #e4d49b;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
}
.brand-sub {
  font-size: 14px;
  color: var(--sub);
  padding-left: 13px;
  border-left: 1px solid #d2dace;
}
nav {
  display: flex;
  gap: 32px;
  align-self: stretch;
}
nav a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--sub);
  font-size: 15px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  padding-top: 3px;
}
nav a[aria-current="page"] {
  color: var(--green);
  border-color: var(--green);
}
.frame {
  padding-top: 28px;
}
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #234c3d;
  border-radius: 16px;
  color: white;
  min-height: 263px;
}
.hero-picture {
  position: absolute;
  inset: 0 0 0 37%;
  background: center 54% / cover no-repeat url(farm-aerial.webp);
  z-index: -2;
}
.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    #163c30 3%,
    #1b4134 33%,
    rgba(28, 65, 51, 0.83) 46%,
    rgba(21, 50, 41, 0.08) 72%
  );
}
.hero-copy {
  padding: 29px 40px 30px;
}
.smallcaps {
  letter-spacing: 0.18em;
  font:
    600 12px/1.65 ui-monospace,
    Menlo,
    monospace;
  letter-spacing: 0.16em;
}
.hero .smallcaps {
  color: #e6d797;
}
.hero h1,
.library-title h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 4.1vw, 58px);
  line-height: 1.17;
  margin: 11px 0 13px;
  font-weight: 700;
  letter-spacing: 0.015em;
}
.hero h1 em {
  color: #f4dfa0;
  font-style: normal;
}
.hero p {
  margin: 0;
  color: #e7eee6;
  font-size: 15px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(270px, 1fr);
  align-items: start;
  gap: 22px;
  margin-top: 23px;
}
.sheet,
.examples,
.toolbar,
.record {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 13px;
}
.sheet,
.examples {
  padding: 24px 28px;
}
.examples {
  background: #edf2e8;
}
.sheet-head,
.actions,
.card-title,
.detail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sheet-head {
  margin-bottom: 16px;
}
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.48;
}
h2 {
  font: 700 25px/1.42 var(--serif);
}
h3 {
  font-size: 18px;
}
h4 {
  font-size: 15px;
}
.textbtn,
.sources-link,
.linklike {
  border: 0;
  padding: 0;
  background: transparent;
  color: #315e46;
  font-size: 14px;
  font-weight: 650;
}
.textbtn:hover,
.linklike:hover {
  text-decoration: underline;
}
.pair,
.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pair {
  margin-bottom: 15px;
}
label {
  display: block;
  font-weight: 600;
  font-size: 14px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  border-radius: 6px;
  border: 1px solid #c6d1c6;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  margin-top: 5px;
}
input::placeholder,
textarea::placeholder {
  color: #6c786f;
}
select {
  appearance: none;
  padding-right: 31px;
  background-image:
    linear-gradient(45deg, transparent 50%, #526857 50%),
    linear-gradient(135deg, #526857 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 51%,
    calc(100% - 12px) 51%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
textarea {
  resize: vertical;
  min-height: 81px;
}
.actions {
  margin-top: 15px;
}
.date {
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.date input {
  width: auto;
  max-width: 163px;
  font-size: 14px;
  margin: 0;
  padding: 6px;
}
.primary {
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: 7px;
  padding: 10px 26px;
  font-weight: 650;
}
.primary:hover {
  background: #143c2b;
}
.primary:disabled,
button:disabled {
  opacity: 0.58;
  cursor: wait;
}
.examples p,
.muted,
.library-title p {
  color: var(--sub);
}
.examples > p {
  margin: 3px 0 13px;
  font-size: 14px;
}
.ex {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  text-align: left;
  border: 0;
  border-top: 1px solid #cfd9c9;
  background: none;
  color: var(--ink);
  width: 100%;
  padding: 12px 0;
  gap: 11px;
}
.ex:hover strong {
  color: #517042;
  text-decoration: underline;
}
.ex-icon {
  width: 32px;
  height: 32px;
  border: 1px solid #b2c0ad;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 17px var(--serif);
}
.ex strong,
.ex small {
  display: block;
}
.ex strong {
  font-size: 15px;
}
.ex small {
  font-size: 12px;
  color: #586b5d;
}
.sources-link {
  display: inline-block;
  margin-top: 8px;
}
.error,
.notice,
.bubble {
  padding: 10px 13px;
  border-radius: 6px;
  margin-top: 15px;
  background: #f1f4eb;
}
.error {
  background: #fff2e6;
  color: #814e23;
}
.bubble {
  background: #ecf2eb;
  overflow-wrap: anywhere;
}
.turn {
  border-top: 1px solid var(--rule);
  margin-top: 23px;
  padding-top: 20px;
}
.turn h3 {
  margin: 15px 0 5px;
}
.turn ul {
  padding-left: 20px;
}
.record {
  margin: 10px 0;
  padding: 15px 16px;
  border-radius: 9px;
}
.record summary {
  cursor: pointer;
  list-style: none;
}
.record summary::-webkit-details-marker {
  display: none;
}
.status,
.meta {
  font-size: 12px;
}
.status {
  background: #e7efdf;
  color: #33533a;
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 650;
}
.status.old {
  background: #f5ebd6;
  color: #6a5128;
}
.meta {
  color: var(--sub);
  letter-spacing: 0.015em;
}
.record h3 {
  font-size: 17px;
  line-height: 1.55;
  margin: 6px 0;
}
.summaryline {
  display: flex;
  justify-content: space-between;
  color: var(--sub);
  gap: 10px;
  font-size: 14px;
}
.summaryline:after {
  content: "展开";
  color: var(--green);
  font-weight: 600;
  flex-shrink: 0;
}
.record[open] .summaryline:after {
  content: "收起";
}
.record-body {
  border-top: 1px solid var(--rule);
  margin-top: 12px;
  padding-top: 12px;
  overflow-wrap: anywhere;
}
.record-body p,
.record-body ul {
  margin: 5px 0 11px;
  white-space: pre-line;
}
.record-body ul {
  padding-left: 21px;
}
.record-body p,
.record-body li {
  font-size: 15px;
}
.record-body h4 {
  margin-top: 13px;
}
.detail-foot {
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 15px;
}
.detail-foot a {
  font-size: 14px;
  font-weight: 650;
}
.library-title {
  padding: 25px 0 10px;
}
.library-title h1 {
  font-size: 42px;
}
.library-title .smallcaps {
  color: #786638;
}
.toolbar {
  padding: 16px 20px;
  grid-template-columns: 2fr 1fr;
}
.muted {
  font-size: 14px;
}
.library-title p {
  margin: 4px 0 12px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 28px;
  padding-bottom: 22px;
  color: #66756a;
  font-size: 12px;
}
#feedback:empty {
  display: none;
}
#feedback {
  font-size: 14px;
  color: var(--sub);
  margin-top: 10px;
}
.record[open] {
  border-color: #9eb39e;
}
.stepnote {
  margin: 6px 0 8px;
  color: var(--sub);
  font-size: 14px;
}
.aiout {
  font-size: 14px;
  background: #f5f4e8;
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
  white-space: pre-line;
}
@media (max-width: 820px) {
  .bar,
  .frame,
  footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    padding: 27px;
  }
  .hero-picture {
    left: 28%;
  }
  .hero:after {
    background: linear-gradient(
      90deg,
      #173d31 1%,
      rgba(23, 61, 49, 0.94) 31%,
      rgba(23, 61, 49, 0.22) 89%
    );
  }
  .sheet,
  .examples {
    padding: 21px;
  }
  .frame {
    padding-top: 18px;
  }
  .bar {
    min-height: 62px;
  }
  .examples {
    order: 2;
  }
}
@media (max-width: 520px) {
  .bar,
  .frame,
  footer {
    padding-left: 13px;
    padding-right: 13px;
  }
  .brand-sub {
    display: none;
  }
  .bar nav {
    gap: 18px;
  }
  .hero {
    min-height: 205px;
  }
  .hero-copy {
    padding: 22px 19px;
  }
  .hero h1 {
    font-size: 38px;
  }
  .hero p {
    max-width: 245px;
    font-size: 14px;
  }
  .hero .smallcaps {
    font-size: 10px;
  }
  .sheet,
  .examples {
    padding: 16px;
  }
  .layout {
    gap: 12px;
    margin-top: 13px;
  }
  .pair {
    gap: 9px;
  }
  .actions {
    align-items: end;
  }
  .date {
    display: block;
    font-size: 12px;
  }
  .date input {
    margin-top: 3px;
  }
  .primary {
    padding: 10px 18px;
  }
  .toolbar {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .library-title h1 {
    font-size: 33px;
  }
  footer {
    flex-wrap: wrap;
  }
  .record {
    padding: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.turn {
  scroll-margin-top: 15px;
}
.smallcaps {
  letter-spacing: 0.09em;
}

.machine-form { max-width: 800px; }
.machine-form label { font-weight: 650; }
.machine-controls { display: flex; gap: 12px; margin: 8px 0; }
.machine-controls input { min-width: 0; flex: 1; }
.machine-controls button { flex: none; }
.machine-row { background: white; border: 1px solid var(--rule); border-radius: 8px; padding: 14px 18px; margin: 8px 0; overflow-wrap: anywhere; font-size: 15px; }
.machine-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; color: var(--green); }
.machine-head strong { font-size: 20px; }
.machine-head span { font-weight: 600; }
.machine-guide { margin-top: 16px; padding: 6px 14px 14px; border-left: 3px solid #b99c54; background: #f5f6ed; }
.machine-guide p { margin: 5px 0 9px; }
.machine-guide .machine-row { padding: 9px 12px; font-size: 14px; }
.machine-guide .machine-head strong { font-size: 17px; }
.guide-links, .machine-paging { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.machine-paging { align-items: center; justify-content: center; }
.guide-links a, .machine-guide a { font-size: 14px; }
@media(max-width:520px){ .bar nav { gap:12px; } .machine-form { padding:15px; } .machine-controls { gap:7px; } .machine-guide { padding-left:10px; } }

.aiout > button {display:block;margin:.75rem 0}
.aiout details {margin:.85rem 0 0}
.aiout details a,.aiout details button {display:inline-block;margin:.2rem 1rem .3rem 0}
.aiout > p {white-space:pre-line}

.guide-settings{display:flex;align-items:center;flex-wrap:wrap;gap:.55rem;margin:1rem 0}.guide-settings label{font-weight:600}.guide-settings select{width:auto;min-width:7rem}.guide-settings .meta{flex:1 1 13rem}
#ledgerRows{display:grid;gap:1rem}.ledger-entry{padding:1.25rem clamp(1rem,3vw,2rem);border:1px solid #cad8cf;border-radius:14px;background:white}.ledger-meta,.ledger-actions{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}.ledger-meta{justify-content:space-between;color:#476253}.ledger-meta strong{background:#eaf1e8;color:#254a35;padding:.2rem .7rem;border-radius:1rem}.ledger-fields{display:grid;grid-template-columns:minmax(8rem,1fr) 3fr;gap:1rem}.ledger-actions{margin-top:.8rem}.ledger-entry h3{margin:.75rem 0 .25rem}.ledger-entry p{margin:.3rem 0 .8rem}.ledger-fields label{display:grid;gap:.3rem}#ledgerMore{margin:1rem 0}#ledgerView{padding-bottom:3rem}.aiout{white-space:pre-line}.bar nav{flex-wrap:wrap}
@media(max-width:650px){.ledger-fields{grid-template-columns:1fr}.bar{flex-wrap:wrap;height:auto;padding-block:.5rem;gap:.3rem}.bar nav{gap:.65rem}}
