/* ============================================================
   人间杂记 · 共享样式（自家版）
   配色：宣纸朱砂 —— 米白纸底 #F7F3EA / 朱砂 #B44A3A / 暖墨 #2B2622
   字体：宋体作标题（不用楷体）+ 无衬线作界面字
   版式：细线分栏、无边框块，文字为主
   ============================================================ */
:root {
  --bg: #f7f3ea;          /* 宣纸米白 */
  --paper: #fffdf8;       /* 干净的纸 */
  --ink: #2b2622;         /* 暖墨，不用纯黑 */
  --ink-soft: #6b6259;
  --ink-faint: #9a9186;
  --accent: #b44a3a;      /* 朱砂 */
  --accent-dark: #8e3628;
  --line: #e0d6c2;        /* 淡赭细线 */
  --line-strong: #cbbec0;
  --block: #f1e9da;       /* 浅色块 */
  --block-2: #f8f2e6;
  --max-width: 1000px;
  --font-body: "Songti SC", "Source Han Serif SC", "Noto Serif SC", STSong, SimSun, Georgia, serif;
  --font-title: "Songti SC", "Source Han Serif SC", "Noto Serif SC", STSong, SimSun, serif;
  --font-ui: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.95;
  padding: 26px 16px 48px;
  -webkit-font-smoothing: antialiased;
}

.site { max-width: var(--max-width); margin: 0 auto; }

/* ---- 顶部：站名 + 菜单 ---- */
.topline { height: 3px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }

/* 首屏防闪：站名/栏目/欢迎词是「可以改的」，为此各页 <head> 里用同步脚本先把设置取回来，
   画第一帧就是自定义内容。万一那一小步慢了或失败了，下面这条先把这几个位置藏住，
   等 site-nav.js 渲染好再撤掉 <html> 上的 site-boot 亮出来 ——
   宁可短暂空一下，也不会先显示默认站名/栏目、再跳变成自定义的。
   用 visibility 而不是 display，是为了占住位置、避免亮出来时页面跳版。
   连脚本都挂了的话，各页 head 里的兜底定时器 1.5 秒后强制显示。 */
html.site-boot .brand-name,
html.site-boot nav.menu,
html.site-boot .welcome[data-site-welcome],
html.site-boot footer[data-site-footer] { visibility: hidden; }

.site-head { text-align: center; padding: 26px 0 12px; }

/* 站名留空时（站长可以在「站点设置」里把网站名称清掉）：整块收掉，不留空档，
   页头只留「细线 + 栏目一行 + 细线」，上边距也收窄一点。
   这个 site-noname 类由 site-nav.js 渲染时按站名是否为空挂到 <html> 上。 */
.brand { display: block; margin-bottom: 12px; }
html.site-noname .brand { display: none; }
html.site-noname .site-head { padding-top: 18px; }
.brand-name {
  font-family: var(--font-title);
  font-size: 30px; font-weight: 700; letter-spacing: 12px;
  text-indent: 12px; color: var(--ink); line-height: 1.35;
}

nav.menu {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px 22px;
  font-family: var(--font-ui);
  /* 栏目这一行夹在上下两条细线中间（padding 上下同值，字才居中） */
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin: 0 auto; max-width: 100%;
}
nav.menu a {
  position: relative; display: inline-block;
  /* 上下同值：栏目行现在被上下两条细线夹着，左右/上下留白对称字才居中 */
  padding: 4px 1px;
  font-size: 14.5px; letter-spacing: 1.5px;
  color: var(--ink-soft); text-decoration: none;
  transition: color .15s;
}
nav.menu a:hover { color: var(--accent); }
/* 当前栏目：只靠朱砂色 + 加粗，不再画下划线 ——
   栏目行本身已经夹在两条细线中间，再垫一条短线会跟底线叠在一起，像画重了一道。
   （2026-10-14 调整；想恢复"下划线标记"就把下面这条 ::after 加回来） */
nav.menu a.active { color: var(--accent); font-weight: 700; }

.welcome {
  text-align: center; font-family: var(--font-ui);
  font-size: 12px; letter-spacing: 5px; color: var(--ink-faint);
  padding: 9px 0 0;
}

/* ---- 主体两栏 ---- */
.main { display: grid; grid-template-columns: 192px 1fr; margin-top: 20px; gap: 0; }
aside {
  border-right: 1px solid var(--line);
  padding: 4px 16px 18px 0;
  font-family: var(--font-ui);
  min-width: 0;
}
.content { padding: 0 0 6px 30px; min-width: 0; }

/* 侧栏：直接放内容，不用小标题，块与块之间只用一道淡线隔开 */
aside .side-block + .side-block {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.quote {
  font-family: var(--font-title); font-size: 15px; line-height: 1.85;
  color: var(--ink); margin-bottom: 6px;
}
.quote-author { text-align: right; font-size: 12px; color: var(--ink-faint); }

/* 侧栏：日期 + 数字时钟 */
.clock-box { padding: 0; }
.clock {
  font-family: var(--font-ui); font-size: 25px; font-weight: 300;
  letter-spacing: 2px; color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.date-solar { font-size: 12px; color: var(--ink-soft); letter-spacing: .5px; }
.date-lunar { font-size: 12px; color: var(--ink-faint); letter-spacing: .5px; }

/* 侧栏：链接与统计 */
.sidebar-links { font-size: 12.5px; line-height: 2.15; color: var(--ink-soft); }
.sidebar-links a { color: var(--ink-soft); text-decoration: none; }
.sidebar-links a:hover { color: var(--accent); }
.stats { font-size: 12.5px; color: var(--ink-soft); line-height: 1.95; }

/* ---- 栏目标题：朱砂短竖线 + 细线，无底色块 ---- */
.column-header {
  font-family: var(--font-title); font-size: 18px; font-weight: 700; color: var(--ink);
  border-left: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  padding: 0 0 7px 10px; margin: 28px 0 10px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.column-header:first-child { margin-top: 0; }
.column-header small { font-family: var(--font-ui); font-weight: 400; font-size: 12px; color: var(--ink-faint); letter-spacing: 1px; }
.column-header .more {
  font-family: var(--font-ui); font-size: 12px; font-weight: 400;
  color: var(--ink-faint); text-decoration: none; letter-spacing: 1px;
}
.column-header .more:hover { color: var(--accent); }

/* 空栏目提示 */
.empty-hint {
  font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-faint);
  padding: 6px 2px 10px; border-bottom: 1px dotted var(--line);
}

ul.posts { list-style: none; }
ul.posts li {
  padding: 8px 2px; border-bottom: 1px dotted var(--line);
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
}
ul.posts li:last-child { border-bottom: none; }
ul.posts a { color: var(--ink); text-decoration: none; }
ul.posts a:hover { color: var(--accent); }
ul.posts .date { font-family: var(--font-ui); font-size: 12px; color: var(--ink-faint); white-space: nowrap; }

/* ---- 文章页 ---- */
.article-head { margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.article-head h1 {
  font-family: var(--font-title); font-size: 25px; line-height: 1.5;
  color: var(--accent); font-weight: 700; margin-bottom: 6px;
}
.article-head .meta { font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-faint); }
.article-body p { text-indent: 2em; margin-bottom: 14px; }

/* ---- 正文插图（发布时选「环绕方式」决定用哪一套） ----
   fig-block：上下环绕 —— 图片独占一行居中，文字在它上下；
   fig-left / fig-right：四周环绕 —— 图片靠一侧，文字绕着它排。
   默认宽：独占一行占满，绕着排的占 42%；发布时可以指定 10%~100%。 */
.article-body figure.fig-block { margin: 18px 0 20px; text-indent: 0; text-align: center; }
.article-body figure.fig-block img {
  max-width: 100%; height: auto; border-radius: 4px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .08); vertical-align: bottom;
}
.article-body figure.fig-block figcaption {
  font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-faint);
  margin-top: 8px; letter-spacing: .5px; line-height: 1.6;
}
.article-body img.fig-wrap { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 6px rgba(0, 0, 0, .08); }
.article-body img.fig-right { float: right; width: 42%; margin: 2px 0 12px 20px; }
.article-body img.fig-left { float: left; width: 42%; margin: 2px 20px 12px 0; }
/* 别让浮动图片把下面的返回链接和评论区也卷进来 */
.article-body::after { content: ""; display: block; clear: both; }

.back-link { font-family: var(--font-ui); font-size: 12.5px; margin-top: 22px; }
.back-link a { color: var(--accent); text-decoration: none; }

/* ---- 评论区 ---- */
.comments { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 16px; }
.comments-title {
  font-family: var(--font-ui); font-size: 14px; font-weight: 700; margin-bottom: 14px;
  letter-spacing: 2px; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}
.comments-title .count { font-weight: 400; font-size: 12.5px; color: var(--ink-faint); letter-spacing: 0; }
.comment {
  background: var(--block-2); border-left: 2px solid var(--line);
  padding: 10px 14px; margin-bottom: 10px;
}
.comment .c-head { font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-faint); margin-bottom: 4px; display: flex; gap: 10px; align-items: baseline; }
.comment .c-head .c-user { font-weight: 700; color: var(--accent); }
.comment .c-body { font-size: 15px; }
.comment .c-actions { font-family: var(--font-ui); font-size: 12px; margin-top: 6px; }
.comment .c-actions button {
  background: none; border: none; color: var(--ink-faint); cursor: pointer; padding: 0 8px 0 0;
  font-family: var(--font-ui); font-size: 12px;
}
.comment .c-actions button:hover { color: var(--accent); }
.comment .replies { margin-top: 8px; margin-left: 20px; }
.comment .replies .comment { background: transparent; border-left: 2px solid var(--accent); }

.comment-form { margin-top: 16px; }
.comment-form .login-tip, .comment-form .logged-in {
  font-family: var(--font-ui); font-size: 13px; margin-bottom: 8px; color: var(--ink-soft);
}
.comment-form .login-tip button {
  background: var(--accent); color: #fff; border: none; border-radius: 2px;
  padding: 5px 16px; font-family: var(--font-ui); font-size: 13px; cursor: pointer; letter-spacing: 1px;
}
.comment-form .login-tip button:hover { background: var(--accent-dark); }
.comment-form textarea {
  width: 100%; min-height: 72px; font-family: var(--font-body); font-size: 15px; line-height: 1.9;
  background: var(--paper); border: 1px solid var(--line); padding: 9px 11px; resize: vertical;
  color: var(--ink);
}
.comment-form textarea:focus, .admin-panel input:focus, .admin-panel textarea:focus, .admin-panel select:focus {
  outline: none; border-color: var(--accent);
}
.comment-form .submit-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
button.submit {
  background: var(--accent); color: #fff; border: none; padding: 6px 20px;
  font-family: var(--font-ui); font-size: 13px; letter-spacing: 2px; cursor: pointer; border-radius: 2px;
}
button.submit:hover { background: var(--accent-dark); }
button.submit:disabled { opacity: .5; cursor: default; }

/* ---- 交流区 ---- */
.board-new {
  background: var(--block); border-left: 3px solid var(--accent);
  padding: 14px 16px; margin-bottom: 20px;
}
.board-new input.board-title-input {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  background: var(--paper); border: 1px solid var(--line); padding: 7px 10px; margin-bottom: 8px;
  color: var(--ink);
}
.threads { list-style: none; }
.threads li {
  background: var(--block-2); border-left: 3px solid var(--line-strong);
  padding: 11px 15px; margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.threads li:hover { background: var(--block); }
.threads li:hover { border-left-color: var(--accent); }
.threads .t-title { font-weight: 700; font-size: 16px; font-family: var(--font-title); }
.threads .t-meta { font-family: var(--font-ui); font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.thread-view .comment { background: var(--block-2); }

footer {
  margin-top: 34px; border-top: 1px solid var(--line); padding-top: 14px;
  text-align: center; font-family: var(--font-ui); font-size: 12px; color: var(--ink-faint);
  letter-spacing: 1px; line-height: 2;
}
footer .motto-slot { color: var(--ink-soft); font-family: var(--font-title); font-size: 13.5px; letter-spacing: 2px; }

/* ---- 删除（危险操作）：按钮 + 小链接 两种形态 ---- */
.article-tools {
  margin: 20px 0 0; padding-top: 12px;
  border-top: 1px dotted var(--line);
  text-align: right;
}
button.btn-del {
  background: none; border: 1px solid var(--line-strong); color: var(--ink-soft);
  font-family: var(--font-ui); font-size: 12.5px; letter-spacing: 1px;
  padding: 5px 16px; border-radius: 2px; cursor: pointer; transition: all .15s;
}
button.btn-del:hover { border-color: var(--accent); color: var(--accent); }
button.btn-del:disabled { opacity: .5; cursor: default; }
.link-del { color: var(--ink-faint); cursor: pointer; font-family: var(--font-ui); font-size: 12px; }
.link-del:hover { color: var(--accent); }

/* ---- 响应式 ---- */
@media (max-width: 760px) {
  body { font-size: 15.5px; padding: 18px 14px 40px; }
  /* 手机上先读文章，家训/时钟/信息等侧栏内容移到后面 */
  .main { display: flex; flex-direction: column; }
  .content { order: 1; padding: 0 0 6px; }
  aside {
    order: 2; margin-top: 26px; padding: 18px 0 0;
    border-right: none; border-top: 1px solid var(--line);
  }
  nav.menu { gap: 4px 16px; }
  nav.menu a { font-size: 13.5px; letter-spacing: .5px; }
  /* 手机上屏幕窄，图片不再左右绕排，一律占满一行居中（!important 压过发布时指定的宽度） */
  .article-body img.fig-right,
  .article-body img.fig-left {
    float: none; display: block; width: 100% !important; margin: 16px auto 18px;
  }
  .article-body figure.fig-block img { width: 100% !important; }
  .brand-name { font-size: 26px; letter-spacing: 8px; text-indent: 8px; }
  ul.posts li { flex-direction: column; gap: 2px; }
}
