:root {
  --paper: #f3efe6;
  --card: #fffdf8;
  --ink: #1c1915;
  --muted: #6f675e;
  --line: #e3d9c8;
  --seal: #c23a2e;
  --seal-ink: #f8efe6;
  --shadow: 0 16px 40px rgba(70, 48, 24, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at top, #faf6ee 0%, transparent 58%),
    linear-gradient(transparent 27px, rgba(194, 58, 46, 0.08) 28px);
  background-size: auto, 100% 28px;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "STSong", Georgia, serif;
  line-height: 1.5;
}

code, .mono, .cmds {
  font-family: "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}

.top, .layout {
  width: min(980px, calc(100% - 2rem));
  margin-inline: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 2.75rem 0 1.25rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--seal);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; }

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.lede {
  max-width: 38rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.seal {
  flex: none;
  width: 5.4rem;
  height: 5.4rem;
  display: grid;
  place-items: center;
  border: 3px solid var(--seal);
  border-radius: 50%;
  color: var(--seal);
  transform: rotate(-14deg);
  box-shadow: inset 0 0 0 1px rgba(194, 58, 46, 0.35);
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-align: center;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.8fr);
  align-items: start;
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.3rem 1.4rem;
}

.desk { border-top: 7px solid var(--seal); }

h2 { margin: 0 0 1rem; font-size: 1.45rem; }

h3 {
  margin: 1.3rem 0 0.55rem;
  font-size: 1.05rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  font-size: 0.92rem;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 5.5rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid #d9cdb8;
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.75rem;
}

button {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  cursor: pointer;
}

button[type="submit"] {
  border: 0;
  background: var(--seal);
  color: var(--seal-ink);
  padding: 0.55rem 1.15rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

button[type="submit"]:disabled { opacity: 0.6; cursor: wait; }

.note button {
  border: 1px solid #d9cdb8;
  background: transparent;
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}

.note button:hover,
button[type="submit"]:hover { filter: brightness(0.96); }

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

.error {
  margin: 0;
  color: var(--seal);
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 0.92rem;
}

.empty, .hint, .explain {
  color: var(--muted);
  font-size: 0.95rem;
}

.empty { margin: 1.2rem 0 0; }

.hint { margin: 1.2rem 0 0; font-size: 0.85rem; }

.notes { list-style: none; margin: 0.4rem 0 0; padding: 0; }

.note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "time action"
    "text action";
  align-items: center;
  gap: 0.15rem 0.85rem;
  padding: 0.85rem 0;
  border-top: 1px dashed var(--line);
}

.note time {
  grid-area: time;
  color: #8a8175;
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.note p { grid-area: text; margin: 0; overflow-wrap: anywhere; }

.note button { grid-area: action; justify-self: end; }

.facts { margin: 0; }

.facts > div {
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.facts > div:first-child { border-top: 0; padding-top: 0; }

.facts dt {
  color: var(--muted);
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.facts dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; }

.files { margin: 0.2rem 0 0; padding-left: 1.1rem; }

.cmds {
  margin: 0;
  padding: 0.85rem 1rem;
  background: #1c1915;
  color: #f3efe6;
  font-size: 0.82rem;
  line-height: 1.55;
  overflow-x: auto;
}

.explain code { font-size: 0.86em; }

@media (max-width: 800px) {
  .top { align-items: flex-start; padding-top: 1.6rem; }
  .layout { grid-template-columns: 1fr; }
  .seal { width: 4.4rem; height: 4.4rem; font-size: 0.68rem; }
}
