:root {
  color-scheme: light;
  font: 16px/1.55 "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: #243428;
  background: #f5f5ed;
  --paper: #fffdf7;
  --border: #d8ded3;
  --muted: #526253;
  --action: #2d5d48;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { width: min(1100px, calc(100% - 32px)); margin: 36px auto 64px; }
section { scroll-margin-top: 16px; }
h1, h2, h3, p { margin: 0 0 .65em; }
h1 { font: 700 clamp(2rem, 6vw, 3.25rem)/1.15 "Songti SC", SimSun, serif; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
small, .muted { font-size: .83rem; color: var(--muted); font-weight: 400; }
.eyebrow { letter-spacing: .24em; color: var(--muted); margin-bottom: 8px; }
.heading, .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.jump, .controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px 16px; }
.jump { margin-bottom: 18px; }
.jump a { padding: 5px 0; }
.panel, .period { padding: clamp(14px, 3vw, 24px); background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
.panel, #overview { margin: 0 0 16px; min-width: 0; }
.narrow { max-width: 420px; }
.narrow form { display: grid; gap: 12px; }
.periods, .columns { display: grid; gap: 12px; }
.periods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.columns { grid-template-columns: 1.25fr 1fr; align-items: start; }
.period dl { display: grid; grid-template-columns: 1fr auto; margin: 0; column-gap: 10px; }
.period dd { margin: 0; font-variant-numeric: tabular-nums; }
label { display: grid; gap: 4px; color: var(--muted); font-size: .9rem; }
.check { display: flex; align-items: center; font-size: 1rem; }
input, select, textarea, button, .button { font: inherit; padding: .55em .75em; border-radius: 8px; }
input, select, textarea { background: white; border: 1px solid var(--border); color: #243428; width: 100%; min-width: 0; }
input[type="checkbox"] { width: auto; }
button, .button { background: var(--action); color: white; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.button { display: inline-block; }
.secondary { color: var(--action); border-color: var(--border); background: white; }
.danger { background: #872e30; }
a { color: var(--action); text-underline-offset: .2em; }
button:disabled { opacity: .6; cursor: wait; }
.stacked { margin-top: 12px; }
.stacked label:has(textarea) { flex: 1 1 100%; }
textarea { resize: vertical; }
#notice:empty { display: none; }
#notice { padding: 10px 12px; background: #e7eee2; border-radius: 8px; }
#notice[data-error="true"] { background: #f7e2df; color: #732b2a; }
ul { padding: 0; margin: 10px 0; list-style: none; }
li, .writing-entry { border-top: 1px solid var(--border); padding: 9px 0; overflow-wrap: anywhere; }
details { margin: 10px 0 0; }
summary { cursor: pointer; color: var(--action); }
.writing-entry p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .6em 0 0; }
.scroll { overflow: auto; }
.heatmap { border-spacing: 3px; table-layout: fixed; min-width: 620px; width: 100%; font-size: .75rem; }
.heatmap th { font-weight: 400; white-space: nowrap; }
.heatmap td { height: 23px; border-radius: 4px; background: #e9eee5; text-align: center; }
.heatmap td[data-level="1"] { background: #cedfcb; }
.heatmap td[data-level="2"] { background: #a7c9ae; }
.heatmap td[data-level="3"] { background: #71a888; }
.heatmap td[data-level="4"] { background: #31684f; color: white; }
@media (max-width: 650px) {
  main { margin-top: 22px; }
  .columns, .periods { grid-template-columns: 1fr; }
  .controls > label { flex: 1 1 135px; }
}
