/* Classical Wabi-Sabi / Japanese Paper Theme (from mizukiri) */

:root {
  --bg: #f7f4ed;
  --surface: #fffef9;
  --border: #d9d2c5;
  --line: #c8c0b2;
  --text: #2c2416;
  --text-dim: #a09888;
  --accent: #3a5660;
  --link-hover: #b84545;
  --code-bg: #eae5da;
  --shadow: 0 1px 3px rgba(44, 36, 22, 0.06), 0 2px 12px rgba(44, 36, 22, 0.04);

  /* Zenburn Theme for multi-line code blocks */
  --zenburn-bg: #3f3f3f;
  --zenburn-fg: #dcdccc;
  --zenburn-accent: #7f9f7f;
  --zenburn-gold: #f0dfaf;
  --zenburn-border: #5f5f5f;
}

/* 铺满全屏视口的和纸背景 (html 节点) */
html {
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(200,185,165,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(185,170,150,0.15) 0%, transparent 55%),
    repeating-linear-gradient(
      0deg, transparent, transparent 2px,
      rgba(175,165,145,0.06) 2px, rgba(175,165,145,0.06) 4px
    );
  background-size: 100vw 100vh, 100vw 100vh, 100% 4px;
  background-attachment: fixed, fixed, scroll;
}

/* 居中的正文容器 (body 节点) */
body {
  font-family: "Songti SC", "Hiragino Mincho Pro", "YuMincho", STSong, "Times New Roman", serif;
  color: var(--text);
  line-height: 1.8;
  width: 100%;
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* Sticky Footer (页脚绝对吸底) */
#content {
  flex: 1 0 auto;
  width: 100%;
}

#postamble {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 400;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  letter-spacing: 0.05em;
}

h1.title {
  font-size: 2.2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 30px;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: all 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

nav {
  padding: 12px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

nav a {
  margin-right: 16px;
}

/* Inline Code (~code~) 改回原本的和纸浅色/白色背景样式 */
code {
  background-color: var(--code-bg);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 2px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.88em;
  border: 1px solid var(--border);
}

/* Zenburn Theme for Multi-line Code Blocks (pre.src / pre.example) */
pre.src, pre.example {
  background-color: var(--zenburn-bg);
  color: var(--zenburn-fg);
  border: 1px solid var(--zenburn-border);
  border-left: 4px solid var(--zenburn-accent);
  border-radius: 4px;
  padding: 16px 20px;
  overflow-x: auto;
  font-family: "Menlo", "SF Mono", "Consolas", monospace;
  font-size: 0.9em;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Zenburn Syntax Highlighting for Org-mode Source Blocks */
.org-keyword { color: #f0dfaf; font-weight: bold; }
.org-string { color: #cc9393; }
.org-comment, .org-comment-delimiter { color: #7f9f7f; font-style: italic; }
.org-function-name { color: #93e0e3; font-weight: bold; }
.org-variable-name { color: #dcdccc; }
.org-type { color: #8cd0d3; }
.org-constant { color: #dca3a3; }
.org-builtin { color: #ffcfaf; }
.org-doc { color: #7f9f7f; }
.org-preprocessor { color: #ffcfaf; }
.org-warning { color: #e3ceee; font-weight: bold; }

#table-of-contents {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 20px 24px;
  margin: 30px 0;
  box-shadow: var(--shadow);
}

#table-of-contents h2 {
  margin-top: 0;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.footer {
  color: var(--text-dim);
}
