*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --accent: #2563eb;
  --text: #1a1a1a;
  --muted: #555;
  --faint: #777;
  --bg: #fff;
  --surface: #f7f7f7;
  --border: #e5e5e5;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans TC", sans-serif;
  font-size: 16px;
  line-height: 1.72;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

#preamble,
#content {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: 1.5rem;
}

#preamble {
  padding-top: 3rem;
}

#content {
  padding-bottom: 5rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-title {
  color: var(--text);
  font-weight: 700;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  align-items: center;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 2rem;
  height: 2rem;
  color: var(--text);
}

.language-picker-icon {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.15rem;
  border-radius: 3px;
  background: var(--text);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.language-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  opacity: 0;
  cursor: pointer;
  font: inherit;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#content h2 {
  margin: 2.2rem 0 0.9rem;
  padding-bottom: 0;
  border-bottom: 0;
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}

#content h3 {
  margin: 1.7rem 0 0.75rem;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.35;
}

#content h4 {
  margin: 1.35rem 0 0.6rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
}

p {
  margin: 0 0 1rem;
}

.lede {
  color: var(--muted);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list li {
  display: grid;
  gap: 0.12rem;
}

.post-list a {
  color: var(--text);
  font-weight: 650;
}

.post-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

time {
  color: var(--faint);
  font-size: 0.84rem;
}

.post-list p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

pre,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.94em;
}

code {
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  background: var(--surface);
}

.site-footer {
  display: flex;
  justify-content: center;
  margin: 3rem auto 1rem;
  padding-inline: 1.5rem;
}

.site-footer img {
  display: block;
  width: 150px;
  height: 44px;
}

@media (max-width: 520px) {
  .page {
    padding: 2rem 1.15rem 4rem;
  }

  #preamble,
  #content {
    padding-inline: 1.15rem;
  }

  #preamble {
    padding-top: 2rem;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2.2rem;
  }

  .site-nav {
    justify-content: flex-start;
  }

  h1 {
    font-size: 1.65rem;
  }
}
