:root {
  --bg: #f5f5f2;
  --paper: #ffffff;
  --text: #222222;
  --muted: #777777;
  --line: #deded8;
  --strong: #2a2a2a;
  --soft: #f0f0ec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.8;
}

.site-header {
  background: var(--strong);
  color: #ffffff;
  padding: 14px 18px;
  border-bottom: 4px solid #555555;
}

.site-title {
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.site-header a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.94rem;
}

.site-header a:hover {
  text-decoration: underline;
}

.content-box {
  max-width: 920px;
  margin: 24px auto;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 3px 3px 0 #dddddd;
}

h1 {
  border-bottom: 2px solid var(--strong);
  padding-bottom: 6px;
  line-height: 1.35;
}

h2 {
  border-left: 6px solid #555555;
  padding-left: 10px;
  margin-top: 32px;
}

h3 {
  border-bottom: 1px dotted #888888;
}

blockquote {
  border-left: 4px solid #999999;
  margin-left: 0;
  padding-left: 16px;
  color: #555555;
}

pre {
  background: #f0f0f0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid #cccccc;
}

code {
  background: #f0f0f0;
  padding: 1px 4px;
}

pre code {
  padding: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}

th,
td {
  border: 1px solid #cccccc;
  padding: 6px 10px;
}

th {
  background: #eeeeee;
}

.download-button {
  display: inline-block;
  padding: 10px 16px;
  border: 2px solid #333333;
  background: #eeeeee;
  color: #111111;
  text-decoration: none;
  font-weight: 700;
  margin: 8px 0;
}

.download-button:hover {
  background: #dddddd;
}

#content img {
  max-width: min(100%, 520px);
  height: auto;
  display: block;
  margin: 14px auto;
  border: 1px solid #666666;
}

#content img.image-missing {
  display: none;
}

.meta,
.diary-date-subtle {
  display: block;
  text-align: right;
  color: var(--muted);
  font-size: 0.86rem;
  margin: -0.2em 0 1.4em;
}

.diary-index-section {
  margin-top: 28px;
}

.diary-index-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.diary-index-head h2 {
  border-left: 0;
  padding-left: 0;
  margin: 0;
}

.diary-index-head span {
  color: var(--muted);
  font-size: 0.86rem;
}

.diary-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.diary-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid #e2e2dc;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.diary-card:hover {
  transform: translateY(-2px);
  border-color: #c8c8c0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.11);
}

.diary-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #eeeeea, #fbfbf8);
  border-bottom: 1px solid #eeeeea;
  display: grid;
  place-items: center;
  color: #a0a09a;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.diary-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  margin: 0;
}

.diary-card-body {
  padding: 16px 17px 18px;
}

.diary-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.diary-card-title {
  border: 0;
  padding: 0;
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.45;
}

.diary-card-excerpt {
  margin: 0;
  color: #555555;
  font-size: 0.92rem;
  line-height: 1.7;
}

.notice {
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.game-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid #cccccc;
  background: #ffffff;
}

.site-footer {
  text-align: center;
  margin: 32px;
  font-size: 14px;
}

.site-footer a {
  color: #666666;
}

@media (max-width: 680px) {
  .content-box {
    margin: 12px;
    padding: 18px;
  }

  .diary-card-grid {
    grid-template-columns: 1fr;
  }
}

.download-note {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 6px 0 18px;
}
