/*
Theme Name: Y2K Space
Author: 燃恋
Description: 千禧年风格的个人空间主题 —— 分类即分区，右侧留言板，附网址订阅，适合做浏览器新标签页。七套色调（赤橙黄绿蓝紫灰）× 明暗模式自由叠加，适配移动端。
Version: 0.9.5
License: GNU General Public License v2 or later
Text Domain: y2k-forum
*/

/* =========================================================================
   1. 配色系统
   ---------------------------------------------------------------------
   data-hue  : 色调（red / orange / yellow / green / blue / purple / gray）
   data-mode : 明暗（light / dark）
   两者正交，可以任意叠加。
   ========================================================================= */

/* --- 中性色（亮色）+ 默认色调 蓝，作为无 JS 时的兜底 --- */
:root {
  /* 中性 */
  --page-bg: #eceef1;
  --panel: #ffffff;
  --line: #c9ced5;
  --line-cell: #dce1e7;
  --line-strong: #aab2bb;

  --text: #2b3035;
  --text-dim: #5b626a;
  --text-mute: #8b939c;

  --head-bg: #f7f8fa;
  --crumbs-bg: #f2f4f6;
  --footer-bg: #f2f4f6;
  --footer-text: #8b939c;

  --on-accent: #ffffff;
  --shadow: rgba(0, 0, 0, 0.14);

  /* 背景点阵（透明度很低，只做质感） */
  --dot: rgba(17, 24, 32, 0.07);

  /* 蓝 */
  --accent: #1a4a8a;
  --link: #1c5399;
  --link-hover: #0f3a6e;
  --row-alt: #f0f5fb;
  --row-hover: #e4eef9;

  --nav-bg: #2b5a92;
  --nav-line: #1d3f6e;
  --nav-text: #ffffff;
  --nav-input-bg: #ffffff;
  --nav-input-text: #333333;
  --nav-input-line: #ffffff;

  --th-bg: #3f6fa8;
  --th-line: #345f94;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "微软雅黑", "Helvetica Neue", Arial, sans-serif;

  /* 等宽字体：只给时间、数字、元信息这类短文本用，做出千禧年老论坛的终端味。
     这些字体本身不含汉字，中文会自动落到后面的苹方/雅黑，
     所以「技术随笔」这种中文标题不会被拉宽，只有数字和英文变成等宽。 */
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Monaco,
               "Cascadia Code", Consolas, "Liberation Mono", "Roboto Mono",
               "PingFang SC", "Microsoft YaHei", monospace;

  /* 站名专用：行楷。macOS 自带「行楷-简」，Windows 装了 Office 的会有「华文行楷」，
     都没有时退到楷体、宋体——都是带笔锋的衬线字形，不会突然变成黑体。
     书法字体没有粗体，所以千万别给它加 font-weight:700，浏览器会做伪粗，
     笔画会糊成一团。 */
  --font-display: "Xingkai SC", "STXingkai", "华文行楷", "Kaiti SC", "STKaiti",
                  "KaiTi", "楷体", "Songti SC", "STSong", "SimSun", serif;
}

/* --- 赤 --- */
[data-hue="red"] {
  --accent: #96201c;
  --link: #a8261f;
  --link-hover: #7a1712;
  --row-alt: #fbf1f0;
  --row-hover: #f8e3e1;

  --nav-bg: #97342c;
  --nav-line: #6d1e19;
  --nav-text: #ffffff;
  --nav-input-bg: #ffffff;
  --nav-input-text: #333333;
  --nav-input-line: #ffffff;

  --th-bg: #a9433a;
  --th-line: #8c2b25;
}

/* --- 橙 --- */
[data-hue="orange"] {
  --accent: #93470f;
  --link: #a5520f;
  --link-hover: #7a3a08;
  --row-alt: #fdf4ea;
  --row-hover: #fbe9d5;

  --nav-bg: #a85d24;
  --nav-line: #743a12;
  --nav-text: #ffffff;
  --nav-input-bg: #ffffff;
  --nav-input-text: #333333;
  --nav-input-line: #ffffff;

  --th-bg: #b86c30;
  --th-line: #964d1c;
}

/* --- 黄（用深黄保证可读性） --- */
[data-hue="yellow"] {
  --accent: #8a6a00;
  --link: #94720a;
  --link-hover: #6d5300;
  --row-alt: #fdfaef;
  --row-hover: #fbf4d9;

  --nav-bg: #8a6d12;
  --nav-line: #6b5409;
  --nav-text: #ffffff;
  --nav-input-bg: #ffffff;
  --nav-input-text: #333333;
  --nav-input-line: #ffffff;

  --th-bg: #9c7c1a;
  --th-line: #7d6312;
}

/* --- 绿 --- */
[data-hue="green"] {
  --accent: #1e6b42;
  --link: #22774a;
  --link-hover: #14502f;
  --row-alt: #eef6f0;
  --row-hover: #e0f0e6;

  --nav-bg: #2a6b47;
  --nav-line: #1a4a2f;
  --nav-text: #ffffff;
  --nav-input-bg: #ffffff;
  --nav-input-text: #333333;
  --nav-input-line: #ffffff;

  --th-bg: #357a52;
  --th-line: #26603e;
}

/* --- 紫 --- */
[data-hue="purple"] {
  --accent: #5b3a8e;
  --link: #67429e;
  --link-hover: #452a6e;
  --row-alt: #f4f0fa;
  --row-hover: #eae2f6;

  --nav-bg: #5e4090;
  --nav-line: #432c6b;
  --nav-text: #ffffff;
  --nav-input-bg: #ffffff;
  --nav-input-text: #333333;
  --nav-input-line: #ffffff;

  --th-bg: #7052a3;
  --th-line: #553a80;
}

/* --- 熊猫灰（黑灰白，无彩色） --- */
[data-hue="gray"] {
  --accent: #1f1f1f;
  --link: #383838;
  --link-hover: #000000;
  --row-alt: #f4f4f4;
  --row-hover: #e9e9e9;

  --nav-bg: #3d3d3d;
  --nav-line: #1f1f1f;
  --nav-text: #ffffff;
  --nav-input-bg: #ffffff;
  --nav-input-text: #333333;
  --nav-input-line: #ffffff;

  --th-bg: #555555;
  --th-line: #3d3d3d;
}

/* --- 中性色（暗色），可叠加在任意色调上 --- */
[data-mode="dark"] {
  color-scheme: dark;

  --page-bg: #101316;
  --panel: #191d21;
  --line: #333a41;
  --line-cell: #2a3037;
  --line-strong: #414a53;

  --text: #cdd3da;
  --text-dim: #98a1ab;
  --text-mute: #6f787f;

  --head-bg: #1a1f24;
  --crumbs-bg: #1d2227;
  --footer-bg: #14181b;
  --footer-text: #6f787f;

  --on-accent: #12161b;
  --shadow: rgba(0, 0, 0, 0.5);
  --dot: rgba(226, 238, 255, 0.06);
}

/* --- 暗色下的各色调 --- */
[data-mode="dark"][data-hue="blue"] {
  --accent: #93c2f0;
  --link: #8fbdf0;
  --link-hover: #bcdcff;
  --row-alt: #1b222b;
  --row-hover: #233140;

  --nav-bg: #1d2c3c;
  --nav-line: #0b1219;
  --nav-text: #e3edf7;
  --nav-input-bg: #131a22;
  --nav-input-text: #cdd3da;
  --nav-input-line: #33404d;

  --th-bg: #2b3f55;
  --th-line: #16222d;
}

[data-mode="dark"][data-hue="red"] {
  --accent: #f0938c;
  --link: #ef918a;
  --link-hover: #ffc0b8;
  --row-alt: #211a19;
  --row-hover: #322220;

  --nav-bg: #33201d;
  --nav-line: #1a0f0d;
  --nav-text: #f7e4e1;
  --nav-input-bg: #171110;
  --nav-input-text: #ddd0ce;
  --nav-input-line: #3d2b28;

  --th-bg: #4a2a26;
  --th-line: #24120f;
}

[data-mode="dark"][data-hue="orange"] {
  --accent: #f0b180;
  --link: #f2b183;
  --link-hover: #ffd4b0;
  --row-alt: #211c16;
  --row-hover: #322518;

  --nav-bg: #33251a;
  --nav-line: #1a110a;
  --nav-text: #f7e8db;
  --nav-input-bg: #17130e;
  --nav-input-text: #ddd2c7;
  --nav-input-line: #3d3126;

  --th-bg: #4a3320;
  --th-line: #24160d;
}

[data-mode="dark"][data-hue="yellow"] {
  --accent: #e8cb72;
  --link: #ecd180;
  --link-hover: #fbe9a8;
  --row-alt: #211f16;
  --row-hover: #322d1c;

  --nav-bg: #332c16;
  --nav-line: #1a160b;
  --nav-text: #f7edd2;
  --nav-input-bg: #17150e;
  --nav-input-text: #ddd6c2;
  --nav-input-line: #3d3826;

  --th-bg: #4a4220;
  --th-line: #241f0d;
}

[data-mode="dark"][data-hue="green"] {
  --accent: #8dd3a8;
  --link: #8ed4a9;
  --link-hover: #b8f0cc;
  --row-alt: #182119;
  --row-hover: #1f2f24;

  --nav-bg: #1b2c21;
  --nav-line: #0a1310;
  --nav-text: #e0f2e6;
  --nav-input-bg: #121a15;
  --nav-input-text: #cdd8d0;
  --nav-input-line: #2d4234;

  --th-bg: #27422f;
  --th-line: #16251b;
}

[data-mode="dark"][data-hue="purple"] {
  --accent: #c8aef0;
  --link: #c4a9ee;
  --link-hover: #e0d0ff;
  --row-alt: #1e1a24;
  --row-hover: #2a2334;

  --nav-bg: #261f33;
  --nav-line: #120e1a;
  --nav-text: #ece4f7;
  --nav-input-bg: #15121a;
  --nav-input-text: #d5cde0;
  --nav-input-line: #382f45;

  --th-bg: #352a45;
  --th-line: #1d1529;
}

[data-mode="dark"][data-hue="gray"] {
  --accent: #e6e6e6;
  --link: #d0d0d0;
  --link-hover: #ffffff;
  --row-alt: #1c1c1c;
  --row-hover: #2b2b2b;

  --nav-bg: #2a2a2a;
  --nav-line: #0d0d0d;
  --nav-text: #f0f0f0;
  --nav-input-bg: #161616;
  --nav-input-text: #d0d0d0;
  --nav-input-line: #383838;

  --th-bg: #3a3a3a;
  --th-line: #1a1a1a;
}

/* =========================================================================
   2. 基础
   ========================================================================= */

* { box-sizing: border-box; }

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

html {
  background: var(--page-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 全页极淡点阵，只做质感，不影响阅读 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.7px);
  background-size: 14px 14px;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

button { font-family: var(--font); }

/* =========================================================================
   3. 顶部：站点名 + 配色开关 + 用户栏
   ========================================================================= */

.site-top {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  max-width: 1460px;
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.logo:hover { text-decoration: none; }

.logo-mark {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  /* 行楷自带笔锋，字距再收就会粘连，这里略微放开一点 */
  letter-spacing: 1.5px;
  line-height: 1.3;
  color: var(--accent);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.logo-sub {
  /* 箴言用宋体：衬线的横细竖粗跟行楷站名是一路的笔意，
     用黑体会显得像一行导航文字。字距略放开，短句才有停顿。 */
  font-family: "Songti SC", "STSong", "SimSun", "宋体", "Noto Serif SC", serif;
  font-size: 16px;
  letter-spacing: 1.2px;
  /* 宋体笔画细，用比页脚更实一级的灰，暗色下才不至于发虚 */
  color: var(--text-dim);
  white-space: nowrap;
}

.top-side {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* --- 配色开关 --- */
.theme-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ts-label {
  font-size: 14px;
  color: var(--text-mute);
  margin-right: 2px;
}

.sw {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.12s, transform 0.12s;
}

.sw[data-hue="red"] { background: #a8302a; }
.sw[data-hue="orange"] { background: #b8621c; }
.sw[data-hue="yellow"] { background: #c9a227; }
.sw[data-hue="green"] { background: #2f7d4f; }
.sw[data-hue="blue"] { background: #2b5a92; }
.sw[data-hue="purple"] { background: #6b4a9e; }
.sw[data-hue="gray"] {
  background: linear-gradient(135deg, #2f2f2f 0 50%, #ededed 50% 100%);
}

.sw:hover { border-color: rgba(0, 0, 0, 0.45); transform: translateY(-1px); }
.sw.is-on { outline-color: var(--accent); }

.ts-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 2px;
}

/* --- 明暗切换：太阳 / 月亮 --- */
.mode-toggle {
  position: relative;
  width: 32px;
  height: 24px;
  flex: 0 0 32px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, color 0.2s;
}

.mode-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mode-toggle svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform 0.4s cubic-bezier(0.34, 1.32, 0.64, 1), opacity 0.26s ease;
}

.mode-toggle .ico-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.35);
}

.mode-toggle .ico-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-mode="light"] .mode-toggle .ico-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-mode="light"] .mode-toggle .ico-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.35);
}

/* --- 用户栏 --- */
.user-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-meta {
  text-align: right;
  line-height: 1.3;
}

.user-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.user-status {
  display: block;
  font-size: 13px;
  color: var(--text-mute);
}

.user-status::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #35a854;
  margin-right: 4px;
  vertical-align: 1px;
}

.user-avatar {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--row-alt);
  cursor: pointer;
  display: block;
  line-height: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-avatar:hover { border-color: var(--accent); }

.avatar-fallback {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  line-height: 1;
}

/* --- 关于我弹层 --- */
.about-pop {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100;
  width: min(300px, calc(100vw - 24px));
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: 3px 3px 0 var(--shadow);
  text-align: left;
}

.about-pop.is-open { display: block; }

.about-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.about-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--row-alt);
  line-height: 0;
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-avatar .avatar-fallback { font-size: 26px; }

.about-id strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  line-height: 1.3;
}

.about-tag {
  display: block;
  font-size: 13px;
  color: var(--text-mute);
}

.about-text {
  margin: 11px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-dim);
}

.about-rows {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed var(--line-cell);
}

.about-row {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.8;
}

.about-key {
  flex: 0 0 34px;
  color: var(--text-mute);
}

.about-val { color: var(--text); }

/* =========================================================================
   4. 导航条 + 搜索
   ========================================================================= */

.site-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-line);
}

.nav-inner {
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: 34px;
}

.nav-inner > a {
  color: var(--nav-text);
  padding: 0 14px;
  line-height: 34px;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-inner > a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--nav-text);
  text-decoration: none;
}

.nav-search {
  margin-left: auto;
  display: flex;
  align-items: stretch;
  padding: 4px 0;
  position: relative;
}

/* 搜索范围下拉 */
.search-scope {
  position: relative;
  display: flex;
}

.scope-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px 0 9px;
  border: 1px solid var(--nav-input-line);
  background: var(--nav-input-bg);
  color: var(--nav-input-text);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.scope-btn:hover { color: var(--accent); }
.scope-btn[aria-expanded="true"] { color: var(--accent); }
.scope-caret { font-size: 11px; opacity: 0.55; }

.scope-list {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 120;
  min-width: 104px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: 2px 2px 0 var(--shadow);
}

.scope-list.is-open { display: block; }

.scope-item {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.scope-item:hover {
  background: var(--row-hover);
  color: var(--accent);
}

.scope-item.is-on {
  color: var(--accent);
  font-weight: 700;
}

.nav-search input {
  width: 170px;
  min-width: 0;
  padding: 3px 7px;
  border: 1px solid var(--nav-input-line);
  border-left: none;
  background: var(--nav-input-bg);
  color: var(--nav-input-text);
  font-size: 14px;
  font-family: var(--font);
}

.nav-search input::placeholder { color: var(--text-mute); }

.nav-search input:focus {
  outline: 1px solid var(--accent);
  outline-offset: -2px;
}

.search-submit {
  border: 1px solid var(--nav-input-line);
  border-left: none;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2328;
  padding: 3px 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.search-submit:hover { background: #ffffff; }

/* =========================================================================
   5. 页面骨架：主栏 + 右栏留言板（拉满到底部）
   ========================================================================= */

.layout {
  max-width: 1460px;
  margin: 0 auto;
  padding: 10px 12px 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 10px;
  align-items: stretch;
}

/* 右栏跟着主内容一起拉高，不吸顶、不浮动 */
.side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.main { min-width: 0; }

.wrap { padding: 0; }

/* =========================================================================
   6. 留言板（右栏，纵向撑满）
   ========================================================================= */

.gb-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
}

.gb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--head-bg);
  border-bottom: 1px solid var(--line);
}

.gb-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* 留言列表吃掉剩余高度，底部条自然贴到面板最下沿 */
.gb-list {
  flex: 1 1 auto;
  padding: 0 10px;
}

.gb-item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-cell);
}

.gb-item:last-child { border-bottom: none; }

.gb-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gb-ava {
  font-size: 16px;
  line-height: 1;
}

.gb-user {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gb-pin {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 2px;
}

.gb-text {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  overflow-wrap: anywhere;
}

.gb-foot {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-mute);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.gb-bottom {
  flex: 0 0 auto;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  background: var(--head-bg);
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.gb-pager {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 5px;
}

.gb-pager a {
  font-size: 16px;
  line-height: 1;
  color: var(--link);
}

.gb-pager a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

/* =========================================================================
   7. 面包屑 / 统计条
   ========================================================================= */

.crumbs {
  padding: 6px 10px;
  background: var(--crumbs-bg);
  border: 1px solid var(--line);
  border-bottom: none;
  font-size: 14px;
  color: var(--text-dim);
}

/* 首页那一条：左边「个人空间」，右边一行时间地点 */
.crumbs.is-now {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
}

/* ---------- 首页右上角：时钟 / 日历 / 天气 ---------- */

.now {
  position: relative;
  flex: 0 0 auto;
  text-align: right;
}

.now-stack {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  line-height: 1.5;
}

.now-sep {
  font-size: 12px;
  color: var(--line-strong);
}

.now-line {
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  background: none;
  border: 0;
  white-space: nowrap;
}

.now-clock {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}

.now-btn {
  cursor: pointer;
}

.now-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}

.now-pop {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 40;
  width: 212px;
  margin-top: 6px;
  padding: 9px 10px 8px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 20px var(--shadow);
}

/* 日历 */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.cal-title {
  font-size: 14px;
  color: var(--text);
}

.cal-nav {
  width: 18px;
  height: 18px;
  padding: 0;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  color: var(--text-dim);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.cal-nav:hover {
  background: var(--row-hover);
  border-color: var(--line);
  color: var(--accent);
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-week span {
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
  padding-bottom: 2px;
}

.cal-d {
  padding: 2px 0;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cal-d.is-weekend {
  color: var(--text-mute);
}

.cal-d.is-today {
  background: var(--accent);
  color: var(--on-accent);
}

/* 这天写过文章：数字下面点一个小点 */
.cal-d.is-mark {
  position: relative;
  font-weight: 700;
}

.cal-d.is-mark::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-d.is-today.is-mark::after {
  background: var(--on-accent);
}

.cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 5px;
  font-size: 10.5px;
  color: var(--text-mute);
  border-top: 1px dotted var(--line-cell);
}

.cal-back {
  padding: 1px 6px;
  font-family: inherit;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--accent);
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
}

.cal-back:hover {
  border-color: var(--accent);
  background: var(--row-hover);
}

/* 天气 */

.wx-day {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 0;
  font-size: 11.5px;
  border-bottom: 1px dotted var(--line-cell);
}

.wx-day:last-of-type {
  border-bottom: 0;
}

.wx-when {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.wx-when em {
  margin-left: 4px;
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-mute);
}

.wx-text {
  flex: 1 1 auto;
  color: var(--text-dim);
}

.wx-temp {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wx-temp i {
  margin-left: 4px;
  font-style: normal;
  color: var(--text-mute);
}

.wx-src {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-mute);
  text-align: right;
}

.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--head-bg);
  border: 1px solid var(--line);
  border-bottom: none;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
}

.stats b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stats .hl { color: var(--text); }
.stats-right { flex: 0 0 auto; }
.stats-right a { color: var(--link); }

/* =========================================================================
   8. 版块表格
   ========================================================================= */

.board-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: var(--panel);
}

.board-table th {
  background: var(--th-bg);
  color: #ffffff;
  font-weight: 400;
  font-size: 14px;
  padding: 7px 9px;
  border: 1px solid var(--th-line);
  text-align: left;
}

.board-table td {
  border: 1px solid var(--line-cell);
  padding: 9px;
  vertical-align: top;
}

.board-table tbody tr:nth-child(odd) { background: var(--row-alt); }
.board-table tbody tr:nth-child(even) { background: var(--panel); }
.board-table tbody tr:hover { background: var(--row-hover); }

.col-num {
  text-align: center;
  width: 84px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.col-last { width: 210px; }

.board-cell {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.board-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.board-info { min-width: 0; }

.board-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.board-desc {
  color: var(--text-dim);
  margin-top: 1px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.board-mod {
  color: var(--text-mute);
  font-size: 13px;
  margin-top: 1px;
}

.last-time {
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.last-title {
  color: var(--link);
  font-size: 14px;
  display: inline-block;
  margin-top: 1px;
  overflow-wrap: anywhere;
}

.empty-note {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 22px 14px;
  color: var(--text-dim);
  text-align: center;
}

/* =========================================================================
   9. 区块标题
   ========================================================================= */

.section-title {
  margin: 16px 0 0;
  padding: 7px 10px;
  background: var(--th-bg);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--th-line);
}

/* =========================================================================
   10. 网址订阅：大格子 + 悬浮介绍
   ========================================================================= */

.bm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line-cell);
  border: 1px solid var(--line);
  border-top: none;
}

.bm-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 74px;
  padding: 14px 14px 14px 15px;
  background: var(--panel);
  color: var(--link);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.bm-item:hover,
.bm-item:focus-visible {
  background: var(--row-hover);
  color: var(--link-hover);
  text-decoration: none;
  border-left-color: var(--accent);
  z-index: 20;
  outline: none;
}

.bm-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.35;
}

.bm-domain {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.bm-tip {
  display: none;
  position: absolute;
  top: calc(100% - 2px);
  left: -1px;
  right: -1px;
  z-index: 40;
  padding: 7px 10px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: 2px 2px 0 var(--shadow);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
  text-align: left;
}

.bm-item:hover .bm-tip,
.bm-item:focus-visible .bm-tip {
  display: block;
}

/* =========================================================================
   11. 页脚
   ========================================================================= */

.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
  padding: 18px 12px;
  text-align: center;
  color: var(--footer-text);
  font-size: 13px;
}

.site-footer p { margin: 4px 0; }
.foot-links a { color: var(--link); }
.foot-copy { color: var(--text-mute); }

/* 备案号：法规硬要求「底部可见、可点击、不藏不缩」。
   页脚整体是浅灰 13px，对比度偏低，所以备案号单独用正文色 + 等宽 14px，
   明暗两套主题都靠 var(--text) 自动反转，不用写两份。 */
.site-footer .foot-icp {
  margin: 10px 0 2px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
}

.site-footer .foot-icp a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer .foot-icp a:hover,
.site-footer .foot-icp a:focus-visible {
  color: var(--link);
  border-bottom-color: currentColor;
  text-decoration: none;
}

.foot-icp-sep {
  margin: 0 6px;
  color: var(--text-mute);
}

/* =========================================================================
   12. 响应式
   ========================================================================= */

@media (max-width: 1200px) {
  .logo-sub { display: none; }
}

/* 窄屏：留言板落到主内容下方，不再纵向撑高 */
@media (max-width: 1080px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    display: block;
    margin-top: 14px;
  }

  .gb-panel { flex: 0 0 auto; }
  .gb-list { flex: 0 0 auto; }
}

@media (max-width: 760px) {

  .top-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px 12px;
  }

  .logo-mark { font-size: 28px; letter-spacing: 1px; }

  /* 窄屏头像缩一档，别把顶部条撑太高 */
  .user-avatar { width: 52px; height: 52px; flex: 0 0 52px; }
  .avatar-fallback { font-size: 22px; }

  .top-side {
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .theme-switch {
    flex-wrap: wrap;
    row-gap: 7px;
    column-gap: 7px;
  }

  .sw { width: 20px; height: 20px; }

  .nav-inner { padding: 0 6px; }

  .nav-inner > a {
    padding: 0 9px;
    line-height: 30px;
    font-size: 14px;
  }

  .nav-search {
    margin-left: 0;
    width: 100%;
    padding: 0 2px 8px;
  }

  .nav-search input {
    flex: 1 1 auto;
    width: auto;
    padding: 5px 7px;
  }

  .search-submit { padding: 5px 12px; }
  .scope-btn { padding: 0 6px 0 8px; }

  .layout { padding: 8px 8px 20px; }

  .stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.85;
    /* 窄屏缩一档：这行是连续文本，14px 等宽在 414px 下会把「最近整理: 燃恋」挤掉行 */
    font-size: 13px;
  }

  /* 中文默认按字断行，窄屏下「燃恋」会被拆成两行，这里禁止在名字中间断 */
  .stats-main b { white-space: nowrap; }

  /* 版块：表格 → 卡片 */
  .board-table tbody tr:hover { background: var(--panel) !important; }

  .board-table {
    display: block;
    border: none;
    background: transparent;
  }

  .board-table thead { display: none; }

  .board-table tbody,
  .board-table tr,
  .board-table td {
    display: block;
    width: auto;
  }

  .board-table tbody tr {
    border: 1px solid var(--line);
    background: var(--panel) !important;
    margin-bottom: 8px;
  }

  .board-table tbody tr:last-child { margin-bottom: 0; }

  .board-table td {
    border: none;
    padding: 0 12px;
  }

  .board-table td.col-board { padding-top: 12px; }

  .board-table td.col-num {
    display: inline-block;
    width: auto;
    text-align: left;
    padding: 6px 0 0 12px;
    color: var(--text-dim);
  }

  .board-table td.col-num::before {
    content: attr(data-label) "：";
    color: var(--text-mute);
  }

  .board-table td.col-last {
    width: auto;
    margin-top: 10px;
    padding: 8px 12px 11px;
    border-top: 1px dashed var(--line-cell);
  }

  .board-table td.col-last .last-time {
    display: inline;
    margin-right: 6px;
  }

  .board-cell { gap: 10px; }

  .board-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 15px;
  }

  .board-name { font-size: 16px; }

  /* 网址订阅 */
  .bm-grid { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }

  .bm-item {
    min-height: 68px;
    padding: 12px 12px 12px 13px;
  }

  .bm-name { font-size: 15px; }

  /* 域名整串是等宽字，13px 下 docs.godotengine.org 会被挤成两行，缩一档 */
  .bm-domain { font-size: 12px; }
}

/* 触摸设备没有 hover：把介绍直接显示在格子里 */
@media (hover: none) {
  .bm-tip {
    position: static;
    display: block;
    padding: 3px 0 0;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-mute);
    font-size: 13px;
  }

  .bm-item { min-height: 0; }
  .bm-item:hover { border-left-color: transparent; }
}

/* 窄屏：右上角那行字别把面包屑挤掉 */
@media (max-width: 760px) {
  .now-stack { gap: 5px; }
  .now-line { font-size: 13px; }
  .now-pop { width: 204px; padding: 8px 9px; }
}

@media (max-width: 380px) {
  .logo-mark { font-size: 24px; letter-spacing: 0.5px; }
  .ts-label { display: none; }
  .nav-inner > a { padding: 0 7px; }
  .bm-grid { grid-template-columns: 1fr; }
  .crumbs.is-now .crumbs-here { display: none; }
  .now-stack { gap: 4px; }
  .now-line { font-size: 10.5px; }
  .now-pop { width: 188px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* =========================================================================
   13. 内容页：版块列表 / 帖子 / 评论 / 404
   ========================================================================= */

/* --- 面包屑补充 --- */
.crumbs a { color: var(--link); }
.crumb-sep { margin: 0 5px; color: var(--text-mute); }
.crumb-here { color: var(--text-dim); }

/* --- 版块页头 --- */
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--head-bg);
  border: 1px solid var(--line);
}

.bh-main { min-width: 0; }

.bh-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--accent);
}

.bh-desc {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}

.bh-side {
  flex: 0 0 auto;
  font-size: 14px;
  color: var(--text-dim);
  white-space: nowrap;
}

.bh-side b { color: var(--accent); }

.bh-search { display: flex; }

.bh-search input {
  width: 170px;
  min-width: 0;
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-right: none;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
}

.bh-search input:focus { outline: 1px solid var(--accent); outline-offset: -2px; }

.bh-search button {
  padding: 3px 11px;
  border: 1px solid var(--line-strong);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.bh-search button:hover { opacity: 0.88; }

/* --- 主题列表（BBS 版块内） --- */
.topic-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-top: none;
  background: var(--panel);
  table-layout: fixed;
}

.topic-table th {
  background: var(--th-bg);
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  padding: 7px 9px;
  border: 1px solid var(--th-line);
  text-align: left;
}

.topic-table td {
  padding: 8px 9px;
  border: 1px solid var(--line-cell);
  font-size: 14px;
  color: var(--text-dim);
  vertical-align: middle;
}

.topic-table tbody tr:nth-child(even) { background: var(--row-alt); }
.topic-table tbody tr:hover { background: var(--row-hover); }

.tcol-author { width: 96px; }
.tcol-num { width: 62px; text-align: center; }
.tcol-last { width: 158px; }

.topic-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topic-dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  background: var(--line-strong);
}

.topic-dot.is-new { background: var(--accent); }

.topic-info { min-width: 0; }

.topic-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--link);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-name:hover { color: var(--link-hover); }

.topic-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-mute);
}

.tag-new {
  display: inline-block;
  margin-left: 4px;
  padding: 0 3px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--on-accent);
  background: var(--accent);
  vertical-align: 1px;
}

.last-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.last-by { font-size: 13px; color: var(--text-mute); }

/* --- 翻页 --- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
}

.pager .page-numbers {
  display: inline-block;
  min-width: 26px;
  padding: 3px 8px;
  font-size: 14px;
  text-align: center;
  color: var(--link);
  background: var(--panel);
  border: 1px solid var(--line);
}

.pager a.page-numbers:hover {
  background: var(--row-hover);
  text-decoration: none;
}

.pager .page-numbers.current {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.pager .page-numbers.dots { border-color: transparent; background: transparent; color: var(--text-mute); }

/* --- 帖子主体 --- */
.thread {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.thread-head {
  padding: 12px 14px 10px;
  background: var(--head-bg);
  border-bottom: 1px solid var(--line);
}

.thread-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 14px;
  padding: 6px 14px;
  background: var(--crumbs-bg);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-mute);
}

.thread-meta b { color: var(--text-dim); }
.tm-item { white-space: nowrap; }
.tm-cmt { color: var(--link); }

.thread-thumb { padding: 14px 14px 0; }

.thread-thumb img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.thread-body { padding: 16px 18px 20px; }

.thread-tags {
  padding: 8px 14px 12px;
  border-top: 1px dashed var(--line-cell);
  font-size: 13px;
}

.tt-label { margin-right: 6px; color: var(--text-mute); }

.thread-tags a {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 1px 6px;
  color: var(--link);
  background: var(--row-alt);
  border: 1px solid var(--line-cell);
}

/* --- 正文排版 --- */
.entry {
  max-width: 880px;
  font-size: 16px;
  line-height: 1.95;
  color: var(--text);
  overflow-wrap: anywhere;
}

.entry > *:first-child { margin-top: 0; }
.entry > *:last-child { margin-bottom: 0; }

.entry p { margin: 0 0 1em; }

.entry h2,
.entry h3,
.entry h4 {
  margin: 1.6em 0 0.6em;
  line-height: 1.45;
  font-weight: 700;
  color: var(--accent);
}

.entry h2 {
  padding-left: 8px;
  font-size: 19px;
  border-left: 3px solid var(--accent);
}

/* 原本 h3 比 h4 还小一号，层级是反的，这里扶正 */
.entry h3 { font-size: 17px; }
.entry h4 { font-size: 16px; }

.entry a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry a:hover { color: var(--link-hover); }

.entry ul,
.entry ol { margin: 0 0 1em; padding-left: 1.7em; }

.entry li { margin: 0.28em 0; }

.entry blockquote {
  margin: 1em 0;
  padding: 8px 12px;
  color: var(--text-dim);
  background: var(--row-alt);
  border-left: 3px solid var(--line-strong);
}

.entry blockquote p:last-child { margin-bottom: 0; }

.entry code {
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--row-alt);
  border: 1px solid var(--line-cell);
}

.entry pre {
  margin: 1em 0;
  padding: 10px 12px;
  overflow: auto;
  line-height: 1.7;
  background: var(--row-alt);
  border: 1px solid var(--line-cell);
}

.entry pre code {
  padding: 0;
  font-size: 12.5px;
  background: none;
  border: none;
}

/* 图片：限宽、居中、轻边框，点一下还能放大看（见 assets/theme.js 的灯箱） */
.entry img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2em auto;
  background: var(--row-alt);
  border: 1px solid var(--line);
  cursor: zoom-in;
}

/* 外面包着链接的图不该抢链接的点击 */
.entry a > img { cursor: pointer; }

.entry figure { margin: 1.2em 0; }

.entry figure img { margin: 0 auto; }

.entry figcaption {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-mute);
  text-align: center;
}

.entry table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  font-size: 15px;
}

.entry th,
.entry td {
  padding: 6px 8px;
  border: 1px solid var(--line-cell);
  text-align: left;
}

.entry th { background: var(--head-bg); }

.entry hr {
  margin: 1.6em 0;
  border: none;
  border-top: 1px solid var(--line);
}

.entry-pages {
  margin-top: 1em;
  font-size: 14px;
  color: var(--text-dim);
}

/* --- 上一篇 / 下一篇 --- */
.post-nav {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.pn-item {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.pn-item:hover { background: var(--row-hover); text-decoration: none; }

.pn-right { text-align: right; }

.pn-label {
  display: block;
  font-size: 13px;
  color: var(--text-mute);
}

.pn-title {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--link);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- 评论区 --- */
.cmt-area { margin-top: 4px; }

.cmt-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: none;
}

.cmt {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-cell);
}

.cmt:last-child { border-bottom: none; }

.cmt-ava { flex: 0 0 36px; }

.cmt-ava img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.cmt-main { flex: 1 1 0; min-width: 0; }

.cmt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--line-cell);
}

.cmt-author {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.cmt-time {
  font-size: 13px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.cmt-wait {
  padding: 0 4px;
  font-size: 12px;
  color: var(--on-accent);
  background: var(--text-mute);
}

.cmt-text {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
  overflow-wrap: anywhere;
}

.cmt-text p { margin: 0 0 0.7em; }
.cmt-text p:last-child { margin-bottom: 0; }

.cmt-actions { margin-top: 4px; font-size: 13px; }
.cmt-actions a { color: var(--text-mute); }
.cmt-actions a:hover { color: var(--accent); }

/* 嵌套回复 */
.cmt .children {
  flex: 0 0 100%;
  margin: 10px 0 0;
  padding: 0 0 0 12px;
  list-style: none;
  border-left: 2px solid var(--line-cell);
}

.cmt .children .cmt {
  padding: 8px 0;
  border-bottom: none;
}

/* 发表框 */
.comment-respond {
  margin-top: 12px;
  padding: 12px 14px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.comment-reply-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.comment-reply-title small { font-size: 13px; font-weight: 400; }
.comment-reply-title small a { color: var(--text-mute); }

.comment-form p { margin: 0 0 10px; }

.comment-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--text-dim);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 6px 8px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: 1px solid var(--accent);
  outline-offset: -2px;
}

.comment-form textarea { resize: vertical; line-height: 1.8; }

.comment-form .submit {
  padding: 5px 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  cursor: pointer;
}

.comment-form .submit:hover { opacity: 0.88; }

.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.comment-form-cookies-consent label {
  display: inline;
  margin: 0;
  font-size: 13px;
}

/* --- 404 --- */
.err-box {
  display: flex;
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.err-code {
  flex: 0 0 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--accent);
  background: var(--head-bg);
  border-right: 1px solid var(--line);
}

.err-body { padding: 20px 22px; }

.err-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.err-text {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dim);
}

.err-search { display: flex; max-width: 340px; }

.err-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 8px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-right: none;
}

.err-search input:focus { outline: 1px solid var(--accent); outline-offset: -2px; }

.err-search button {
  padding: 5px 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  cursor: pointer;
}

.err-links { margin-top: 12px; font-size: 14px; }

/* 留言板空状态 */
.gb-empty {
  margin: 14px 0;
  font-size: 14px;
  color: var(--text-mute);
  text-align: center;
}

/* =========================================================================
   14. 内容页响应式
   ========================================================================= */

@media (max-width: 1080px) {
  .entry { max-width: none; }
}

@media (max-width: 760px) {

  .board-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .bh-side { white-space: normal; }

  .bh-search { width: 100%; }

  .bh-search input {
    flex: 1 1 auto;
    width: auto;
  }

  /* 主题表 → 卡片 */
  .topic-table {
    display: block;
    border: none;
    background: transparent;
    table-layout: auto;
  }

  .topic-table thead { display: none; }

  .topic-table tbody,
  .topic-table tr,
  .topic-table td { display: block; width: auto; }

  .topic-table tr {
    margin-bottom: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
  }

  .topic-table tbody tr:nth-child(even) { background: var(--panel); }
  .topic-table tbody tr:hover { background: var(--panel); }

  .topic-table td {
    padding: 7px 10px;
    border: none;
    border-bottom: 1px solid var(--line-cell);
  }

  .topic-table td:last-child { border-bottom: none; }

  .topic-table td[data-label] {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    text-align: right;
  }

  .topic-table td[data-label]::before {
    content: attr(data-label);
    color: var(--text-mute);
  }

  .topic-name { white-space: normal; }

  .thread-title { font-size: 16px; }
  .thread-body { padding: 12px 12px 16px; }
  .thread-meta { gap: 3px 10px; }
  .entry { font-size: 13.5px; line-height: 1.9; }

  .post-nav { flex-direction: column; }
  .pn-right { text-align: left; }

  .cmt { padding: 10px; }
  .comment-respond { padding: 10px 12px 12px; }

  .err-box { flex-direction: column; }

  .err-code {
    flex: none;
    padding: 14px 0;
    font-size: 44px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .err-body { padding: 16px 14px; }
  .err-search { max-width: none; }
}

/* =========================================================================
   15. 对齐修正
   ---------------------------------------------------------------------
   导航项自带 14px 内边距，会让「论坛」比下方内容左侧多缩进一格。
   把首项的左内边距归零，使 顶部 logo / 导航首项 / 面包屑 / 版块表 左边缘对齐。
   ========================================================================= */

.nav-inner > a:first-child { padding-left: 0; }

/* 右侧同理：搜索框外沿与内容右边缘对齐 */
.nav-inner > .nav-search { padding-right: 0; }

/* 写作台入口：只在登录后出现，做成一颗小按钮，别抢搜索框的视线 */
.nav-inner > .nav-desk {
  margin-left: 12px;
  padding: 0 10px;
  line-height: 22px;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 2px;
}

.nav-inner > .nav-desk:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* =========================================================================
   16. 留言本：提交表单 / 审核提示 / 分页
   ========================================================================= */

/* 提交结果提示 */
.gb-flash {
  margin: 8px 10px 0;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--line);
  border-left-width: 3px;
}

.gb-flash.is-ok {
  color: var(--text-dim);
  background: var(--row-alt);
  border-left-color: var(--accent);
}

.gb-flash.is-err {
  color: var(--text);
  background: var(--row-alt);
  border-left-color: #c0392b;
}

/* 列表可压缩，不把面板顶破 */
.gb-list { min-height: 0; }

/* 待审标记 */
.gb-pin-wait {
  margin-left: 0;
  color: var(--text);
  background: var(--line-strong);
}

.gb-pending-note {
  margin-left: 4px;
  color: var(--accent);
}

/* 分页 */
.gb-pager {
  align-items: center;
  gap: 9px;
}

.gb-page {
  font-size: 12px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

/* 评论审核提示 */
.review-note {
  margin: 0 0 10px;
  padding: 6px 9px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  background: var(--row-alt);
  border-left: 2px solid var(--accent);
}

/* =========================================================================
   17. 补充说明（站长专用回帖区，替代评论）
   ========================================================================= */

/* 头像位：没上传头像时用名字首字色块，绝不出网请求 gravatar */
.cmt-ava-char {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--line);
}

/* 「楼主补充」标记 */
.note-tag {
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--on-accent);
  background: var(--accent);
}

/* 补充条目的分割更轻一点，读起来像同一帖里的续写 */
.cmt.is-note .cmt-head { border-bottom-style: dotted; }

.cmt.is-note .cmt-text {
  color: var(--text);
  font-size: 15px;
}

.cmt-actions a + a { margin-left: 12px; }

/* 补充说明的输入框比原评论框矮一点 */
.comment-form textarea { min-height: 84px; }

/* =========================================================================
   Markdown 排版（文章正文 / 补充说明 / 留言本）
   ========================================================================= */

/* 代码块：等宽、浅底、左边一道粗线 */
.md-code {
  margin: 0 0 1em;
  padding: 10px 12px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  background: var(--row-alt);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  tab-size: 2;
}

.md-code code {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

/* 行内代码：排除代码块里面那层 */
.thread-body :not(pre) > code,
.cmt-text :not(pre) > code,
.gb-text :not(pre) > code,
.desk-note-text :not(pre) > code {
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--text);
  background: var(--row-hover);
  border: 1px solid var(--line-cell);
}

/* 表格 */
.md-table {
  width: 100%;
  margin: 0 0 1em;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.7;
}

.md-table th,
.md-table td {
  padding: 5px 9px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line-cell);
}

.md-table thead th {
  font-weight: 700;
  color: var(--text);
  background: var(--row-hover);
}

.md-table tbody tr:nth-child(even) {
  background: var(--row-alt);
}

/* 引用 */
.thread-body blockquote,
.cmt-text blockquote,
.desk-note-text blockquote {
  margin: 0 0 1em;
  padding: 6px 12px;
  color: var(--text-dim);
  background: var(--row-alt);
  border-left: 3px solid var(--accent);
}

.thread-body blockquote > :last-child,
.cmt-text blockquote > :last-child {
  margin-bottom: 0;
}

/* 分隔线 */
.thread-body hr,
.cmt-text hr {
  height: 0;
  margin: 18px 0;
  border: 0;
  border-top: 1px dashed var(--line-cell);
}

/* 正文里的图片别撑破版心 */
.thread-body img,
.cmt-text img,
.gb-text img {
  max-width: 100%;
  height: auto;
}

/* 段落节奏：默认 margin 有点松，收一点 */
.thread-body p { margin: 0 0 0.9em; }
.thread-body > :first-child { margin-top: 0; }
.thread-body > :last-child { margin-bottom: 0; }

.gb-text p { margin: 0 0 0.6em; }
.gb-text p:last-child { margin-bottom: 0; }

/* 表格对齐（用类名而不是 style 属性，wp_kses 才不会吞掉） */
.md-table .md-center { text-align: center; }
.md-table .md-right { text-align: right; }

/* 正文里的音频：[music](地址 "曲名") 独占一行时才有 */
.md-audio {
  margin: 1.2em 0;
  text-align: center;
}

.md-audio audio {
  display: block;
  width: 100%;
  max-width: 420px;
  height: 34px;
  margin: 0 auto;
}

.md-audio figcaption {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-mute);
}

/* 附件：[file](地址 "文件名") 渲染成一条能点的下载条 */
.md-file { margin: 1em 0; }

/* 编辑器插的对齐块（<div style="text-align:…">）跟段落保持一样的节奏，
   否则它会紧贴着上一行，看着像被挤住了 */
.thread-body > div[style*="text-align"],
.cmt-text > div[style*="text-align"],
.gb-text > div[style*="text-align"],
.ed-preview-body > div[style*="text-align"] {
  margin: 0 0 0.9em;
}

.md-file a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 7px 12px;
  color: var(--text) !important;
  background: var(--head-bg);
  border: 1px solid var(--line-cell);
  border-radius: 2px;
  text-decoration: none !important;
}

.md-file a:hover {
  background: var(--row-hover);
  border-color: var(--accent);
}

/* 一个折角的纸片，纯 CSS，不加载图标字体 */
.md-file-ico {
  position: relative;
  flex: none;
  width: 11px;
  height: 14px;
  border: 1.3px solid var(--text-mute);
  border-radius: 1px;
}

.md-file-ico::before {
  content: '';
  position: absolute;
  top: -1.3px;
  right: -1.3px;
  width: 4px;
  height: 4px;
  background: var(--head-bg);
  border-left: 1.3px solid var(--text-mute);
  border-bottom: 1.3px solid var(--text-mute);
}

.md-file-name {
  min-width: 0;
  overflow: hidden;
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.md-file-hint {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}

/* =========================================================================
   18. 图片 / 相册 / 灯箱
   ========================================================================= */

/* --- 相册页：方格子照片墙 --- */

.layout.is-solo { grid-template-columns: minmax(0, 1fr); }

.album-intro { margin-top: 12px; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.album-item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--row-alt);
  border: 1px solid var(--line);
}

.album-item img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.album-item:hover img { transform: scale(1.045); }

/* 悬停描边：不用滤镜，暗色亮色都稳 */
.album-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 transparent;
  transition: box-shadow 0.2s ease;
}

.album-item:hover::after,
.album-item:focus-visible::after { box-shadow: inset 0 0 0 2px var(--accent); }

.album-item:focus-visible { outline: none; }

.album-empty {
  margin-top: 12px;
  padding: 30px 12px;
  text-align: center;
  font-size: 15px;
  color: var(--text-mute);
  background: var(--panel);
  border: 1px dashed var(--line-strong);
}

/* --- 灯箱：点图放大 --- */

html.lb-open { overflow: hidden; }

.lb {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 64px;
  background: rgba(8, 10, 14, 0.93);
}

.lb[hidden] { display: none; }

.lb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

.lb-img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.lb-cap {
  margin-top: 10px;
  max-width: 70ch;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.74);
  text-align: center;
}

.lb-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.lb-close:hover { background: rgba(255, 255, 255, 0.18); }

.lb-arrow {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 68px;
  margin-top: -34px;
  font-size: 30px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.lb-arrow:hover { background: rgba(255, 255, 255, 0.18); }

.lb-arrow.is-prev { left: 10px; }
.lb-arrow.is-next { right: 10px; }

.lb.is-single .lb-arrow { display: none; }

@media (max-width: 760px) {
  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 6px;
  }

  .lb { padding: 16px; }

  /* 手机上翻页用键盘不现实，箭头又挡图，索性只留「点一下关掉」 */
  .lb-arrow { display: none; }
  .lb-img { max-height: calc(100vh - 110px); }
  .lb-close { top: 8px; right: 8px; }
}
