:root {
  color-scheme: light;
  --page-bg: #f5f7fb;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-sub: #4b5563;
  --border: #e5e7eb;
  --accent: #2563eb;
  --radius: 14px;
  --content-width: 760px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text-main);
  background: linear-gradient(180deg, #f8faff 0%, var(--page-bg) 100%);
  line-height: 1.75;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body > * {
  width: min(var(--content-width), calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
}

body > h1:first-of-type {
  margin-top: 20px;
}

h1,
h2,
h3 {
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: #111827;
}

h1 {
  margin: 20px auto 12px;
  padding-bottom: 10px;
  font-size: clamp(1.4rem, 4.8vw, 1.85rem);
  border-bottom: 1px solid var(--border);
}

h2 {
  margin: 24px auto 10px;
  font-size: clamp(1.15rem, 4vw, 1.3rem);
}

h3 {
  margin: 22px auto 8px;
  font-size: clamp(1.02rem, 3.7vw, 1.1rem);
  color: var(--text-sub);
}

p,
ul,
ol,
pre,
blockquote,
table {
  margin-top: 0;
  margin-bottom: 14px;
}

ul,
ol {
  padding-left: 1.2em;
}

li + li {
  margin-top: 0.35em;
}

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

a:hover {
  text-decoration: underline;
}

/* Markdown export often wraps list-like text in <pre><code>. */
pre {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

pre code {
  font-family: inherit;
  font-size: 0.96rem;
  color: inherit;
  line-height: inherit;
}

.hljs {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
}

:not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 6px;
  padding: 0.15em 0.4em;
}

blockquote {
  background: #f8fafc;
  border-left: 3px solid #93c5fd;
  border-radius: 8px;
  padding: 10px 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px auto;
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
    line-height: 1.7;
  }

  body > * {
    width: calc(100% - 18px);
  }

  h1 {
    margin-top: 14px;
    margin-bottom: 10px;
  }

  h3 {
    margin-top: 18px;
  }

  pre {
    padding: 12px 13px;
    border-radius: 12px;
  }
}
