:root {
  --mono-font: "Berkeley Mono", "JetBrains Mono", "Fira Code",
    "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans-font: -apple-system, BlinkMacSystemFont, "avenir next", Avenir,
    "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", Ubuntu, Roboto, Noto,
    "Noto Sans CJK SC", "Segoe UI", Arial, sans-serif;
  --bg: #fff;
  --bg: light-dark(#fff, #111);
  --bg-dim: #fff;
  --bg-dim: light-dark(#fff, #191919);
  --text: #111;
  --text: light-dark(#111, #ccc);
  --text-dim: #333;
  --text-dim: light-dark(#333, #999);
  --link: var(--text);
  --link-blue: blue;
  --link-blue: light-dark(blue, #b5b5ff);
  --link-visited: #333;
  --link-visited: light-dark(#333, #aaa);
  --border: #333;
  --border: light-dark(#333, #888);
  --border-dim: #eee;
  --border-dim: light-dark(#eee, #555);
  --mode-border: light-dark(#555, #eee);
  --mode-dark: #555;
  --mode-light: #fff;
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans-font);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-skip-ink: auto;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

ul,
ol {
  margin: 1rem 0;
}

ul ul,
ol ul {
  margin: 0;
}

li {
  margin: 0.15rem 0;
}

code,
pre {
  font-family: var(--mono-font);
}

pre {
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px solid var(--border-dim);
  background: var(--bg-dim);
}

hr {
  height: 1px;
  margin: 2rem 0;
  background: var(--border);
  border: 0;
}

h1,
h2,
h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  margin-top: 0;
  font-size: 2rem;
  letter-spacing: 0.004em;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: 0;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: 0;
}

p {
  margin: 1rem 0;
}

blockquote {
  margin: 0;
  padding: 10px 20px;
  overflow-x: auto;
  background: var(--bg);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.55;
}

blockquote p:first-child {
  margin-top: 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

.callout {
  margin: 1.25rem 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--bg-dim);
}

.callout > :first-child {
  margin-top: 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

.site-frame {
  position: relative;
}

.limiter {
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 20px;
  padding-left: 20px;
}

.pad2y {
  padding-top: 20px;
  padding-bottom: 20px;
}

.only-print {
  display: none;
}

.no-print {
  display: block;
}

.header h2 {
  margin: 0 0 0.25em;
  font-size: 1rem;
  line-height: 1.6;
}

.header ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mode-container {
  position: absolute;
  top: 50px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mode {
  display: block;
  width: 18px;
  height: 18px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  background: transparent;
  border: 2px solid var(--mode-border);
  border-radius: 10px;
  opacity: 0.25;
  text-indent: -10000px;
}

.mode-container:hover .mode {
  opacity: 1;
}

.mode.is-selected {
  opacity: 0.55;
}

.mode:hover {
  cursor: pointer;
}

.mode:focus-visible {
  outline: 1px solid var(--link-blue);
  outline-offset: 2px;
  opacity: 1;
}

.mode.auto {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><rect width='100%' height='100%' fill='white'/><path fill='%23777' d='M0,0L0,20L20,20L0,0'/></svg>");
}

.mode.light {
  background-color: var(--mode-light);
}

.mode.dark {
  background-color: var(--mode-dark);
}

.front-page-title {
  display: block;
  padding-bottom: 5px;
  font-weight: 900;
  text-decoration: none;
}

.front-page-title:hover {
  text-decoration: underline;
}

.writing,
.books {
  display: grid;
  grid-row-gap: 5px;
  grid-column-gap: 5px;
}

.writing {
  grid-template-columns: 1fr min-content;
}

.books {
  grid-template-columns: 1fr 0.75fr min-content 70px;
}

.books a,
.writing a {
  font-weight: 500;
  letter-spacing: -0.015em;
}

.books time,
.writing time {
  padding-right: 0.25em;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.012em;
  white-space: nowrap;
}

.books > div,
.writing > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.books > div:nth-child(4n) {
  overflow: visible;
  color: var(--text);
  font-size: 0.875rem;
  text-overflow: clip;
  white-space: nowrap;
}

.reading-note h1 {
  font-size: 30px;
}

.book-rating {
  display: inline-block;
  margin-left: 10px;
  color: var(--text);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
}

.book-details {
  padding-left: 1.2rem;
}

.front-page-images,
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 5px;
}

.front-page-images > div,
.photos-grid > figure {
  display: flex;
  align-items: center;
  margin: 0;
  line-height: 0;
}

.front-page-images img,
.photos-grid img,
.body img,
.body video {
  width: 100%;
  height: auto;
}

.front-page-images img,
.photos-grid img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.photos-grid figcaption {
  display: none;
}

.micro > div {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.micro > div > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.micro > div > div:first-child h2 {
  margin: 0;
  font-size: inherit;
  line-height: 1rem;
}

.micro time {
  line-height: 1rem;
  white-space: pre;
}

.micro > div > div.body {
  padding: 20px;
  background: var(--bg-dim);
}

.micro > div > div.body > p:first-child {
  margin-top: 0;
}

.micro > div > div.body > p:last-child {
  margin-bottom: 0;
}

.micro a {
  color: var(--link-blue);
}

.micro-archive {
  margin-top: 56px;
}

.micro-archive h2 {
  margin: 0 0 16px;
  font-size: 2.7rem;
  line-height: 1;
}

.micro-archive-tags {
  line-height: 1.7;
}

.micro-archive-tags a {
  display: inline;
  padding: 1px 6px 2px;
  background: var(--bg-dim);
  color: var(--text);
  text-decoration-color: var(--border);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.micro-archive-tags a:hover,
.micro-archive-tags a:focus {
  color: var(--link-blue);
  text-decoration-color: currentColor;
}

.body img,
.body video {
  max-width: 640px;
}

.media-block {
  margin: 1.25rem 0;
}

.media-block video {
  display: block;
}

.media-block figcaption {
  margin-top: 0.35rem;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.body li,
.micro li {
  list-style-type: "-  ";
}

.post-meta,
.small,
small {
  color: var(--text-dim);
  font-size: 0.875rem;
}

.postamble {
  display: block;
  margin-top: 2rem;
  color: var(--text-dim);
}

.about-list {
  padding-left: 1rem;
}

.about-list li {
  list-style-type: "-  ";
}

.notitle .body p:first-child {
  margin-top: 0.25rem;
}

.project-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.project-box a.project {
  color: var(--link);
  text-decoration: none;
}

.project-box a.project:hover {
  text-decoration: underline;
}

.project-box a.project img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}

.project-box a.project strong {
  display: block;
}

.project-box a.project span {
  display: block;
  color: var(--text-dim);
  font-size: 0.875rem;
  line-height: 1.4;
}

.photo-nav {
  padding: 5px 5px 0;
  color: var(--text);
  background: var(--bg);
}

.photo-nav h1,
.photo-nav a {
  display: inline-block;
  padding: 3px 5px;
}

.photo-nav h1 {
  margin: 0;
  font-size: inherit;
  font-weight: 400;
}

.photo-nav a {
  text-decoration: none;
}

.photo-nav a:hover,
.photo-nav .is-current-photo {
  text-decoration: underline;
}

.archive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  padding: 20px;
}

.archive > div {
  display: flex;
  align-items: center;
  padding: 5px;
  line-height: 0;
}

.drawings-page.archive-page .archive > div {
  padding: 10%;
}

.archive img {
  width: 100%;
  height: auto;
}

.archive .dark {
  background: #000;
}

.photos-page section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100%;
  min-height: 100vh;
}

.photos-page section.dark {
  background: #000;
}

.photos-page section img {
  display: block;
  width: min(760px, calc(100vw - 100px));
  height: auto;
  max-width: calc(100vw - 100px);
  max-height: calc(100vh - 100px);
  object-fit: contain;
}

.photos-page section video {
  display: block;
  width: min(760px, calc(100vw - 100px));
  height: auto;
  max-width: calc(100vw - 100px);
  max-height: calc(100vh - 100px);
}

.drawings-page section img {
  width: min(800px, calc(100vw - 100px));
}

.photo-meta {
  max-width: 640px;
  padding: 0 25px 80px;
  margin: 50px auto 0;
}

.admin-page {
  min-height: 100vh;
}

.admin-app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  padding: 24px 20px;
  border-right: 1px solid var(--border-dim);
  background: var(--bg);
}

.admin-sidebar h1 {
  margin: 0;
  font-size: 1.25rem;
}

.admin-sidebar p,
.admin-panel-head p {
  margin: 4px 0 0;
  color: var(--text-dim);
}

.admin-nav {
  display: grid;
  gap: 2px;
  margin-top: 28px;
}

.admin-nav button,
.admin-sidebar-actions button,
.admin-sidebar-actions a,
.admin-panel button,
.admin-actions a {
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.admin-nav button {
  padding: 5px 0;
  color: var(--text-dim);
}

.admin-nav button:hover,
.admin-nav button.is-active {
  color: var(--text);
  text-decoration: underline;
}

.admin-sidebar-actions {
  display: grid;
  gap: 8px;
}

.admin-workspace {
  width: min(1180px, 100%);
  padding: 32px 36px 72px;
}

.admin-mobile-top {
  display: none;
}

.admin-panel {
  display: none;
}

.admin-panel-active {
  display: block;
}

.admin-panel-head,
.admin-actions,
.admin-row {
  display: flex;
  gap: 12px;
}

.admin-panel-head {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-panel h2 {
  margin: 0;
  font-size: 1.5rem;
}

.admin-actions {
  align-items: center;
  flex-wrap: wrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-meta-grid {
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.8fr) 150px 130px 130px;
}

.admin-panel label {
  display: block;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 600;
}

.admin-panel input,
.admin-panel textarea,
.admin-panel select {
  width: 100%;
  margin-top: 4px;
  padding: 8px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  font: inherit;
}

.admin-panel textarea {
  padding: 12px;
  border: 1px solid var(--border);
  font-family: var(--mono-font);
  font-size: 0.92rem;
  line-height: 1.55;
  resize: vertical;
}

.admin-panel button,
.admin-actions a {
  display: inline-block;
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 10px;
}

.editor-toolbar button {
  min-width: 34px;
  padding: 5px 8px;
  color: var(--text-dim);
  border-color: var(--border-dim);
}

.editor-toolbar button:hover {
  color: var(--text);
  border-color: var(--border);
}

.editor-label {
  margin-top: 8px;
}

.editor-source-data[hidden] {
  display: none;
}

.visual-editor {
  min-height: min(720px, calc(100vh - 330px));
  padding: 20px 22px;
  border: 1px solid var(--border);
  background: var(--bg);
  outline: none;
  overflow: auto;
}

.visual-editor:focus {
  border-color: var(--link-blue);
}

.visual-editor:focus-within {
  border-color: var(--link-blue);
}

.visual-editor-surface {
  min-height: calc(min(720px, calc(100vh - 330px)) - 42px);
  outline: none;
}

.visual-editor-surface p:first-child,
.visual-editor-surface h2:first-child,
.visual-editor-surface h3:first-child {
  margin-top: 0;
}

.visual-editor-surface p.is-editor-empty:first-child::before {
  float: left;
  height: 0;
  color: var(--text-dim);
  content: "Write here...";
  pointer-events: none;
}

.visual-editor > :first-child {
  margin-top: 0;
}

.visual-editor > :last-child {
  margin-bottom: 0;
}

.visual-editor img,
.visual-editor video,
.visual-editor-surface img,
.visual-editor-surface video {
  display: block;
  max-width: 100%;
  height: auto;
}

.visual-editor figure {
  margin: 1.25rem 0;
}

.visual-editor figcaption {
  margin-top: 0.45rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.admin-row {
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
}

.admin-row small {
  display: block;
  color: var(--text-dim);
}

.admin-row div:last-child {
  display: flex;
  gap: 6px;
}

.admin-login-panel {
  padding: 20px 0;
}

.admin-login-panel input {
  width: 100%;
  margin-top: 4px;
  padding: 8px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  font: inherit;
}

.admin-login-panel button {
  margin-top: 16px;
  padding: 7px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  font: inherit;
  cursor: pointer;
}

@media screen and (min-width: 640px) {
  .nu a {
    text-decoration: none;
  }

  .nu a:hover {
    text-decoration: underline;
  }
}

@media screen and (max-width: 640px) {
  .limiter {
    width: auto;
  }

  .books,
  .writing {
    grid-template-columns: 1fr;
    grid-row-gap: 0;
  }

  .books > div,
  .writing > div {
    white-space: normal;
  }

  .books > div:nth-child(4n),
  .writing time {
    padding-bottom: 20px;
  }

  .front-page-images > div:nth-child(5) {
    display: none;
  }

  .project-box {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-aspect-ratio: 4 / 3) {
  .photos-page section img {
    width: calc(100vw - 100px);
    height: auto;
  }
}

@media (min-aspect-ratio: 4 / 3) {
  .photos-page section img {
    max-width: calc(100vw - 100px);
    max-height: calc(100vh - 100px);
  }
}

@media (min-width: 480px) {
  .photo-meta {
    display: flex;
    justify-content: space-between;
  }

  .photo-meta div:nth-child(2) {
    text-align: right;
  }
}

@media screen and (max-width: 1024px) {
  .header-wrap {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
  }

  .mode-container {
    top: 30px;
    gap: 10px;
  }

  .admin-app {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    padding: 18px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border-dim);
  }

  .admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 16px;
  }

  .admin-sidebar-actions {
    display: none;
  }

  .admin-mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
  }

  .admin-workspace {
    padding: 20px;
  }

  .visual-editor {
    min-height: 360px;
  }
}

@media screen and (min-width: 1025px) {
  .header {
    position: absolute;
    top: 42px;
    right: 50%;
    width: 160px;
    margin-right: 340px !important;
    letter-spacing: 0;
  }

  .content h1:first-child {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .admin-panel-head,
  .admin-row {
    display: block;
  }

  .admin-grid,
  .admin-meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    margin-top: 12px;
  }
}

@media (max-width: 480px) {
  .photo-nav h1 {
    display: block;
  }

  .project-box {
    grid-template-columns: 1fr;
  }
}

@media (max-aspect-ratio: 4 / 3) and (max-width: 480px) {
  .photos-page section {
    min-height: 50vh;
    padding: 40px 0;
  }

  .photos-page section img {
    width: 100vw;
  }
}

@media (min-aspect-ratio: 4 / 3) and (max-width: 480px) {
  .photos-page section img {
    max-height: 100vh;
  }
}

@media print {
  .no-print {
    display: none;
  }

  .only-print {
    display: block;
  }

  body {
    margin: 0;
  }

  .limiter {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
