:root {
  --bg: #F6F1E8;
  --ink: #1C1917;
  --muted: #6F6A63;
  --faint: #9A948B;
  --line: #E2DACD;
  --link: #1F4B7A;
  --title: #8A1C16;
  --account: #1A56DB;
  --serif: "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "Newsreader", serif;
  --sans: "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
}
body {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 2200px;
  margin: 0 auto;
  padding: 0 28px 20px;
  min-height: 0;
}

header.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.mark {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.18em;
  font-weight: 700;
}
.archive {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.date-block {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 12px;
  flex: 0 0 auto;
}
.date-block h1 {
  margin: 0;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.weekday {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-left: 10px;
  letter-spacing: 0.08em;
}
.day-nav {
  font-family: var(--sans);
  font-size: 13px;
  display: flex;
  gap: 18px;
}
.day-nav a { color: var(--muted); }
.day-nav .disabled { color: var(--faint); }

.briefs {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.brief {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 8px 28px 0;
  border-right: 1px solid var(--line);
}
.brief::after {
  content: "";
  position: absolute;
  left: 0;
  right: 8px;
  bottom: 0;
  height: 56px;
  background: linear-gradient(to bottom, rgba(246,241,232,0), var(--bg) 85%);
  pointer-events: none;
}
.brief:first-child { padding-left: 0; }
.brief:last-child {
  border-right: none;
  padding-right: 0;
}

.sec-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  flex: 0 0 auto;
}
.sec-head h2 {
  margin: 0;
  grid-column: 2;
  justify-self: center;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--title);
}
.sec-time {
  grid-column: 3;
  justify-self: end;
}
.sec-time {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.body-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  padding-right: 14px;
  padding-bottom: 36px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #B7AFA3 transparent;
}
.body-scroll::-webkit-scrollbar { width: 10px; }
.body-scroll::-webkit-scrollbar-track { background: #EDE6DA; border-radius: 8px; }
.body-scroll::-webkit-scrollbar-thumb {
  background: #B7AFA3;
  border-radius: 8px;
}

.body p { margin: 0 0 0.95em; }
.body h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 1.25em 0 0.55em;
}
.body h3:first-child { margin-top: 0; }
.body ul {
  margin: 0 0 1em;
  padding-left: 1.15em;
}
.body li { margin: 0 0 0.75em; }
.body strong { font-weight: 700; }
.body h4, .body h5, .body h6 {
  font-size: 15px;
  font-weight: 700;
  margin: 1.1em 0 0.5em;
}
.body h5, .body h6 { color: var(--muted); }
.body ol { margin: 0 0 1em; padding-left: 1.4em; }
.body blockquote {
  margin: 0 0 1em;
  padding-left: 1em;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.body code {
  font-size: 0.9em;
  background: #EDE6DA;
  padding: 0 0.3em;
  border-radius: 3px;
}
.body pre, .body pre.raw {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 1em;
}
.body table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  margin: 0 0 1em;
  font-size: 14px;
  line-height: 1.5;
}
.body th, .body td {
  border: 1px solid var(--line);
  padding: 4px 8px;
  vertical-align: top;
}
.body th { background: #EDE6DA; text-align: left; }
.body hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.body img { max-width: 100%; }
.body { overflow-wrap: anywhere; }
a.account {
  color: var(--account);
  font-weight: 700;
}
a.account:hover { text-decoration: underline; }
.archive-page { flex: 1; overflow-y: auto; padding: 24px 0 40px; }
.archive-page h1 { font-size: 24px; font-weight: 400; margin: 0 0 16px; letter-spacing: 0.04em; }
.archive-list { list-style: none; margin: 0; padding: 0; max-width: 640px; }
.archive-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.archive-list .count { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.archive-list .wd { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-left: 10px; }
.links {
  font-family: var(--sans);
  font-size: 12px;
  display: inline;
}

.pending-body {
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}
.pending {
  margin: 0;
  color: var(--faint);
  font-size: 16px;
}

@media (max-width: 900px) {
  html, body { height: auto; }
  .app {
    height: auto;
    padding: 0 22px 64px;
  }
  .date-block {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 22px 0 8px;
  }
  .date-block h1 { font-size: 32px; }
  .day-nav { justify-content: space-between; }
  .briefs { display: block; }
  .brief {
    border-right: none;
    border-top: 1px solid var(--line);
    padding: 28px 0 8px;
    margin-top: 8px;
  }
  .body-scroll {
    overflow: visible;
    padding-right: 0;
  }
  .brief::after { display: none; }
  .archive-page { overflow: visible; }
}
