@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* === 基础重置与变量 === */
:root {
  --bg: #f5f5f5;
  --bg-elevated: #f1f1f1;
  --bg-hover: #e8eaf6;
  --border: #333333;
  --border-light: #e0e0e0;
  --text: #333333;
  --text-dim: #666666;
  --text-head: #1a1a1a;
  --accent: #1e3a8a;
  --accent-hover: #2563eb;
  --link: #1e3a8a;
  --link-hover: #2563eb;
  --wiki-link: #1e3a8a;
  --warn: #8b6914;
  --radius: 4px;
  --sidebar-width: 260px;
  --header-height: 64px;
  --font-body: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, 'Noto Sans SC', monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* === 顶部报头 === */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center;
  padding: 0 20px;
  z-index: 100;
  gap: 16px;
}
.menu-toggle {
  display: none;
  background: none; border: none; color: var(--text);
  font-size: 22px; cursor: pointer; padding: 4px 8px;
  font-family: sans-serif;
}
.menu-toggle:hover { background: var(--bg-hover); }
.site-title {
  font-size: 22px; font-weight: 700;
  color: var(--text-head); text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-body);
  letter-spacing: 1px;
}
.site-title:hover { color: var(--accent); }
.site-title small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: -4px;
}
.header-search {
  flex: 1; display: flex; justify-content: flex-end; position: relative;
  max-width: 300px; margin-left: auto;
}
#searchInput {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 7px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
}
#searchInput:focus { border-color: var(--border); }
.search-results {
  position: absolute;
  top: calc(100% + 6px); right: 0;
  width: min(420px, 92vw);
  max-height: 60vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  display: none;
}
.search-results:has(*) { display: block; }
.search-item {
  display: block; padding: 10px 14px;
  text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-body);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg-hover); }
.search-item-title { font-weight: 700; color: var(--link); font-size: 15px; }
.search-item-snippet { font-size: 13px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.no-result { padding: 14px; color: var(--text-dim); font-size: 14px; text-align: center; }

/* === 布局 === */
.layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-light);
  position: fixed;
  top: var(--header-height); bottom: 0; left: 0;
  overflow-y: auto;
  padding: 20px 0;
}
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 28px 80px;
  background-color: #fafafa;
  background-image:
    linear-gradient(#e8e8e8 1px, transparent 1px),
    linear-gradient(90deg, #e8e8e8 1px, transparent 1px);
  background-size: 24px 24px;
  min-width: 0; /* 防止 flex 子项撑破布局 */
  position: relative; /* 供水印绝对定位 */
}

/* 角色词条：article 靠左 + 半透明（让水印从后方透出） */
.content:has(.char-watermark) article {
  margin-left: 0;
  margin-right: auto;
  background: rgba(255, 255, 255, 0.84);
}

article {
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
  padding: 36px 48px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: relative;
  z-index: 1; /* 浮于水印之上 */
  isolation: isolate;
  overflow: hidden;
}

/* === 侧边栏导航（文件夹标签页） === */
.nav-tree { padding: 0 10px; }

/* 每个分组是一个标签页 */
.nav-group {
  margin-bottom: -10px;          /* 层叠：后面的标签压住前面的 */
  position: relative;
  z-index: 1;
}

/* 展开的分组浮在上方 */
.nav-group:not(.collapsed) { z-index: 5; }

/* 当前分组浮在最上层 */
.nav-group.current { z-index: 10; }

/* 标签头 */
.nav-group-title {
  position: relative;
  display: flex; align-items: center;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 9px 28px;
  cursor: pointer; user-select: none;
  font-family: var(--font-body);
  background: var(--bg);
  border: 1.5px solid var(--border-light);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  margin: 0 10px;
  color: var(--text-dim);
  z-index: 2;
}

/* 左斜边 */
.nav-group-title::before {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: -3px;
  width: 8px;
  height: calc(100% + 1.5px);
  background: inherit;
  border: 1.5px solid var(--border-light);
  border-bottom: none;
  border-right: none;
  border-radius: 4px 0 0 0;
  transform: skewX(-6deg);
  transform-origin: bottom right;
  z-index: -1;
}

/* 右斜边 */
.nav-group-title::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  right: -3px;
  width: 8px;
  height: calc(100% + 1.5px);
  background: inherit;
  border: 1.5px solid var(--border-light);
  border-bottom: none;
  border-left: none;
  border-radius: 0 4px 0 0;
  transform: skewX(6deg);
  transform-origin: bottom left;
  z-index: -1;
}

.nav-group-title:hover { color: var(--text); }
.nav-group-title .arrow {
  display: inline-block; margin-right: 6px;
  font-size: 10px; transition: transform 0.2s;
  font-family: sans-serif;
}
.nav-group.collapsed .arrow { transform: rotate(-90deg); }
.nav-group.collapsed .nav-list { display: none; }

/* 当前分组：标签头深棕底（含伪元素） */
.nav-group.current .nav-group-title,
.nav-group.current .nav-group-title::before,
.nav-group.current .nav-group-title::after {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* 标签内容区域 - 与标签头左右对齐 */
.nav-list {
  list-style: none;
  margin: 0 10px;
  padding: 10px 14px 28px;
  background: var(--bg);
  border: 1.5px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 10px 10px;
  position: relative;
  z-index: 1;
}

/* 列表项横线分割 */
.nav-list > li {
  margin: 0;
  border-bottom: 1px solid var(--border-light);
}
.nav-list > li:last-child { border-bottom: none; }
.nav-list a {
  display: block; padding: 6px 10px;
  color: var(--text); text-decoration: none;
  font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-body);
  border-radius: 4px;
}
.nav-list a:hover { background: var(--bg-hover); color: var(--link-hover); text-decoration: underline; }
.nav-list a.active { background: var(--bg-hover); color: var(--accent); font-weight: 700; }

/* === 二级子分组（派閥/子目录） === */
.nav-subgroup { list-style: none; margin: 2px 0; border-bottom: none !important; }
.nav-subgroup-title {
  display: flex; align-items: center;
  font-size: 12px; font-weight: 700;
  color: var(--text-dim);
  padding: 5px 8px 4px 4px;
  cursor: pointer; user-select: none;
  letter-spacing: 0.5px;
  font-family: var(--font-body);
  border-left: 2px solid var(--border-light);
  margin-left: 2px;
}
.nav-subgroup-title:hover { color: var(--text); border-left-color: var(--accent); }
.nav-subgroup-title .subarrow {
  display: inline-block; margin-right: 5px;
  font-size: 8px; font-family: sans-serif;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.nav-subgroup:not(.open) .subarrow { transform: rotate(0deg); }
.nav-subgroup.open .subarrow { transform: rotate(90deg); }
.nav-subgroup:not(.open) .nav-sublist { display: none; }
.nav-sublist {
  list-style: none; margin: 2px 0 4px;
  padding: 0 0 0 14px;
  border-left: 1px dashed var(--border-light);
  margin-left: 5px;
}
.nav-sublist li { margin: 0; border-bottom: none !important; }
.nav-sublist a {
  display: block; padding: 3px 8px;
  color: var(--text); text-decoration: none;
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-body);
}
.nav-sublist a:hover { background: var(--bg-hover); color: var(--link-hover); }
.nav-sublist a.active { background: var(--bg-hover); color: var(--accent); font-weight: 700; }

/* === 面包屑 === */
.breadcrumbs {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 20px;
  font-family: var(--font-body);
}
.breadcrumbs a { color: var(--text-dim); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; color: var(--accent); }
.breadcrumbs span { margin: 0 6px; color: var(--border-light); }

/* === 报纸首页 === */
/* ══════════════════════════════════════════════
   报纸首页
   ══════════════════════════════════════════════ */
.newspaper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 40px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
}

/* ── 报头 ── */
.masthead {
  text-align: center;
  border-bottom: 4px double var(--border);
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.masthead h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 3px;
  margin: 0;
  color: #fff;
  background: var(--accent);
  padding: 8px 20px;
  display: inline-block;
  text-transform: uppercase;
  line-height: 1.1;
}
.masthead-sub {
  font-size: 15px;
  color: var(--text-dim);
  letter-spacing: 6px;
  margin: 10px 0 0;
  font-weight: 400;
}
.masthead-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 6px 4px;
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── 头条区（无右侧边栏，图文等高）── */
.np-headline {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 3px double var(--border);
}
.np-hl-main {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.np-hl-img-wrap {
  flex-shrink: 0;
  display: flex;
}
.np-hl-img {
  width: 170px;
  height: 240px;          /* 固定高度，不随文字伸缩 */
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--border-light);
  display: block;
  cursor: zoom-in;
  transition: opacity .15s;
}
.np-hl-img:hover { opacity: .88; }
.np-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
}
.np-hl-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.np-hl-text h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
  font-family: var(--font-body);
}
.np-hl-text h2 a { color: var(--text-head); text-decoration: none; }
.np-hl-text h2 a:hover { color: var(--accent); text-decoration: underline; }
.np-hl-text p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-dim);
  text-align: justify;
  margin: 0 0 12px;
  flex: 1;
}
.np-hl-text .read-more {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.np-hl-text .read-more:hover { text-decoration: underline; }

/* ── 分割线 ── */
.np-section-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.np-section-rule::before,
.np-section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── 故事卡片网格（3列×2行）── */
.np-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 14px;
}

/* 故事卡：图片固定尺寸在左，文字自然撑高
   覆盖全局 article 的 border-radius / overflow */
.np-story {
  background: var(--bg);
  padding: 12px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  border-right: 1px solid var(--border-light);
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}
/* 最后一列去右边框；第一行加下边框（3列：前3，2列：前2）*/
.np-story:last-child { border-right: none; }
.np-story:nth-child(-n+3) { border-bottom: 1px solid var(--border-light); }
.newspaper[data-tmpl="1"] .np-story:nth-child(-n+3) { border-bottom: none; }
.newspaper[data-tmpl="1"] .np-story:nth-child(-n+2) { border-bottom: 1px solid var(--border-light); }

/* 立绘缩略图：尺寸固定，不影响卡片高度 */
.np-card-img-wrap {
  flex-shrink: 0;
  width: 56px;
  height: 74px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.np-card-img {
  width: 56px;
  height: 74px;
  object-fit: cover;
  object-position: top center;
  display: block;
  cursor: zoom-in;
  transition: opacity .15s;
}
.np-card-img:hover { opacity: .9; }

/* 文字区 */
.np-story-body {
  flex: 1;
  min-width: 0;           /* 允许 flex 子项收缩 */
  display: flex;
  flex-direction: column;
}
.np-story h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 5px;
  line-height: 1.3;
  color: var(--text-head);
  font-family: var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-story h3 a { color: inherit; text-decoration: none; }
.np-story h3 a:hover { text-decoration: underline; color: var(--accent); }
.np-story p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-dim);
  margin: 0 0 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.np-story .read-more {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  margin-top: auto;
}
.np-story .read-more:hover { text-decoration: underline; }

/* ── 报纸底栏（一行）── */
.newspaper-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 2px double var(--border);
  padding-top: 12px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
}
.np-brief-inline { flex: 1; }
.np-footer-reload { flex-shrink: 0; white-space: nowrap; }
.newspaper-footer a { color: var(--accent); }

/* ══════════════════════════════════════════════
   三种每日模板变体
   ══════════════════════════════════════════════ */

/* 模板1：画报 — 2+3列，报头空心风格 */
.newspaper[data-tmpl="1"] .masthead h1 {
  background: transparent;
  color: var(--text-head);
  border-top: 5px solid var(--text-head);
  border-bottom: 5px solid var(--text-head);
  padding: 10px 0;
  letter-spacing: 6px;
}
.newspaper[data-tmpl="1"] .masthead {
  border-bottom: 2px solid var(--border);
}
.newspaper[data-tmpl="1"] .np-grid { grid-template-columns: repeat(2, 1fr); }
.newspaper[data-tmpl="1"] .np-card-img-wrap { width: 70px; height: 92px; }
.newspaper[data-tmpl="1"] .np-card-img { width: 70px; height: 92px; }
.newspaper[data-tmpl="1"] .np-story h3 { font-size: 15px; }
.newspaper[data-tmpl="1"] .np-story p { font-size: 13px; line-height: 1.7; -webkit-line-clamp: 6; }

/* 模板2：速报 — 4+4列，密集，粗边框报头 */
.newspaper[data-tmpl="2"] .masthead h1 {
  background: var(--text-head);
  color: #fff;
  font-size: 30px;
  letter-spacing: 8px;
  padding: 10px 28px;
  outline: 3px solid var(--text-head);
  outline-offset: 3px;
}
.newspaper[data-tmpl="2"] .masthead {
  border-bottom: 6px solid var(--border);
}
.newspaper[data-tmpl="2"] .np-grid { grid-template-columns: repeat(3, 1fr); }
.newspaper[data-tmpl="2"] .np-story { padding: 10px; gap: 8px; }
.newspaper[data-tmpl="2"] .np-card-img-wrap { width: 50px; height: 66px; }
.newspaper[data-tmpl="2"] .np-card-img { width: 50px; height: 66px; }
.newspaper[data-tmpl="2"] .np-story h3 { font-size: 13px; }
.newspaper[data-tmpl="2"] .np-story p { font-size: 11px; line-height: 1.6; -webkit-line-clamp: 4; }
.newspaper[data-tmpl="2"] .np-hl-text h2 { font-size: 22px; }
.newspaper[data-tmpl="2"] .np-grid { border: 2px solid var(--border); }
.newspaper[data-tmpl="2"] .np-section-rule::before,
.newspaper[data-tmpl="2"] .np-section-rule::after {
  height: 2px;
  background: var(--border);
}

/* ── 报纸移动端 ── */
@media (max-width: 1200px) {
  .newspaper { max-width: 100%; }
}
@media (max-width: 768px) {
  .newspaper { padding: 16px 14px; }
  .masthead h1 { font-size: 20px; padding: 6px 12px; letter-spacing: 2px; }
  .masthead-sub { font-size: 11px; letter-spacing: 3px; }
  .masthead-meta { font-size: 10px; padding: 4px; }
  .np-hl-main { align-items: flex-start; }
  .np-hl-img { width: 120px; min-height: 160px; height: auto; }
  .np-grid,
  .newspaper[data-tmpl="1"] .np-grid,
  .newspaper[data-tmpl="2"] .np-grid { grid-template-columns: repeat(2, 1fr); }
  .np-card-img-wrap { width: 56px; height: 74px; }
  .np-card-img { width: 56px; height: 74px; }
  .newspaper-footer { flex-direction: column; gap: 14px; }
  .np-brief-box { width: 100%; }
}
@media (max-width: 480px) {
  .np-hl-main { flex-direction: column; }
  .np-hl-img { width: 100%; height: 200px; }
  .np-grid,
  .newspaper[data-tmpl="1"] .np-grid,
  .newspaper[data-tmpl="2"] .np-grid { grid-template-columns: 1fr; }
}

/* === 文章排版（报纸风格） === */
article { color: var(--text); }
article h1 {
  font-size: 32px; font-weight: 700;
  color: var(--text-head); margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 3px double var(--border);
  font-family: var(--font-body);
  line-height: 1.3;
}
article h2 {
  font-size: 22px; font-weight: 700;
  color: var(--text-head); margin: 36px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-body);
  line-height: 1.35;
}
article h3 {
  font-size: 18px; font-weight: 700;
  color: var(--text-head); margin: 26px 0 10px;
  font-family: var(--font-body);
}
article h4 {
  font-size: 16px; font-weight: 700;
  color: var(--text-head); margin: 20px 0 8px;
  font-family: var(--font-body);
}
article p { margin: 0 0 14px; text-align: justify; }
article a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
article a:hover { color: var(--link-hover); }
article a.wiki-link { color: var(--wiki-link); }
article ul, article ol { margin: 0 0 14px; padding-left: 28px; }
article li { margin: 4px 0; }
article blockquote {
  margin: 16px 0; padding: 10px 18px;
  border-left: 4px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-style: italic;
}
article blockquote p:last-child { margin-bottom: 0; }
article hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 28px 0;
}

/* === 表格（线框表） === */
article table {
  width: 100%; border-collapse: collapse;
  margin: 16px 0; font-size: 14px;
  border: 1px solid var(--border);
}
article th, article td {
  border: 1px solid var(--border-light);
  padding: 8px 12px; text-align: left;
}
article th {
  background: var(--bg-elevated);
  font-weight: 700; color: var(--text-head);
  border-bottom: 2px solid var(--border);
}
article tr:nth-child(even) { background: rgba(0,0,0,0.02); }

/* === 代码 === */
article code {
  background: var(--bg-elevated);
  padding: 2px 6px; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 14px;
  color: var(--accent);
  border: 1px solid var(--border-light);
}
article pre {
  background: var(--bg-elevated);
  padding: 14px 16px; border-radius: var(--radius);
  overflow-x: auto; margin: 16px 0;
  border: 1px solid var(--border-light);
}
article pre code { background: none; padding: 0; color: var(--text); border: none; }

/* === Frontmatter 信息条（弱化：小字灰色，不抢焦点） === */
.meta-bar {
  display: flex; flex-wrap: wrap; gap: 0;
  margin-bottom: 14px; font-size: 11px;
  font-family: var(--font-body);
  color: var(--text-dim);
  opacity: 0.72;
}
.meta-tag {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}
.meta-tag:not(:last-child)::after { content: ' · '; margin: 0 4px; color: var(--border-light); }
.meta-tag .label { color: inherit; font-weight: 600; margin-right: 3px; }

/* === 页脚 === */
.page-footer {
  margin-top: 60px; padding-top: 24px;
  border-top: 1px solid var(--border-light);
  font-size: 13px; color: var(--text-dim);
  text-align: center; line-height: 1.8;
  font-family: var(--font-body);
}

/* === 响应式断点 === */

/* 中等屏幕（平板横向 / 小笔记本）：缩小侧边栏与内边距 */
@media (max-width: 1200px) {
  :root { --sidebar-width: 230px; }
  .content { padding: 24px 20px 80px; }
  article { padding: 28px 32px; }
}

/* 移动端（≤768px）：侧边栏收起、全宽内容 */
@media (max-width: 768px) {
  :root { --sidebar-width: 260px; }
  .menu-toggle { display: block; }
  .sidebar {
    transform: translateX(-110%);
    transition: transform 0.25s ease;
    z-index: 90;
    box-shadow: 4px 0 20px rgba(0,0,0,0.12);
    background: var(--bg);
    border-right: 1px solid var(--border-light);
  }
  .sidebar.open { transform: translateX(0); }
  .content {
    margin-left: 0;
    padding: 16px 12px 60px;
  }
  article {
    padding: 20px 18px;
    border-radius: 6px;
  }
  .site-title { font-size: 17px; }
  .site-title small { display: none; }
  .header-search { max-width: 150px; }
  #searchInput { font-size: 13px; padding: 6px 10px; }
  article h1 { font-size: 24px; }
  article h2 { font-size: 19px; }
  article h3 { font-size: 16px; }
  article h4 { font-size: 14px; }
  article table { font-size: 13px; }
  article th, article td { padding: 6px 8px; }
  article ul, article ol { padding-left: 20px; }
}

/* === 洞悉水印（.content 层绝对定位，article 半透明后透出） === */
.char-watermark {
  position: absolute;
  right: 0;
  top: 0;
  /* 宽度用 clamp：普通屏 ~700px，2K 约 1100px，4K 约 1400px */
  width: clamp(700px, 58%, 1500px);
  pointer-events: none;
  user-select: none;
  z-index: 0; /* 低于 article(z-index:1)，高于 .content 背景 */
}
.char-watermark img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.42;
  mix-blend-mode: multiply; /* 透明/白色区消失，彩色部分叠于浅色底 */
}
@media (max-width: 768px) {
  .char-watermark { display: none; }
}

/* === 画廊页卡 === */
.gallery-tab-group { /* 独立作用域容器 */ }
.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.gallery-tab {
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: 0.5px;
  color: var(--text-dim);
  cursor: pointer;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-light);
  border-radius: 20px; /* pill */
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.6;
}
.gallery-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-hover);
}
.gallery-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.gallery-panel { display: none; }
.gallery-panel.active { display: block; }

/* 立绘与单品两个 tab-group 之间的分隔线 */
.gallery-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 14px 0 16px;
}

/* === 剧情图行内注入 === */
/* float-left：跟随 h3 标题，图文并排 */
.story-img-float {
  float: left;
  margin: 3px 20px 10px 0;
  max-width: 180px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  clear: left;
}
.story-img-float img {
  width: 100%;
  display: block;
  cursor: zoom-in;
  border-radius: var(--radius);
  transition: opacity 0.15s;
}
.story-img-float img:hover { opacity: 0.88; }
/* block：{{storyimg:}} 占位符，居中展示 */
.story-img-block {
  clear: both;
  margin: 28px auto;
  text-align: center;
  max-width: 640px;
}
.story-img-block img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
  cursor: zoom-in;
  border: 1px solid var(--border-light);
}
/* 新的 h2/h3 前自动清除浮动 */
article h2, article h3 { clear: both; }
@media (max-width: 768px) {
  .story-img-float {
    float: none;
    max-width: 100%;
    margin: 0 0 14px;
  }
}

/* === 角色画廊 === */
.char-gallery {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 3px double var(--border);
}
.gallery-section { margin-bottom: 18px; }
.gallery-section:last-child { margin-bottom: 0; }
.gallery-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px; margin-bottom: 10px;
}
/* 主立绘横向滚动行 */
.portraits-row {
  display: flex; flex-wrap: nowrap;
  gap: 12px; overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.portrait-fig {
  flex-shrink: 0; margin: 0; text-align: center;
}
.portrait-fig img {
  max-height: 240px; width: auto; display: block;
  cursor: zoom-in;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: opacity .15s;
}
.portrait-fig img:hover { opacity: .82; }
.portrait-fig figcaption {
  font-size: 11px; color: var(--text-dim); margin-top: 4px;
}
/* 签名收藏：单图居中展示，留白衬出笔迹 */
.signature-section {
  display: flex; justify-content: center;
  padding: 16px 8px;
  background: var(--surface, #fafaf7);
  border-radius: var(--radius);
}
.signature-fig {
  margin: 0; text-align: center;
}
.signature-fig img {
  max-height: 280px; max-width: 100%;
  cursor: zoom-in;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: opacity .15s;
}
.signature-fig img:hover { opacity: .82; }
/* 单品小图行 */
.items-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start;
}
.item-fig { margin: 0; text-align: center; }
.item-fig img {
  max-height: 88px; width: auto; display: block;
  cursor: zoom-in;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: opacity .15s;
}
.item-fig img:hover { opacity: .82; }
.item-fig figcaption {
  font-size: 10px; color: var(--text-dim); margin-top: 3px;
  max-width: 100px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
/* 时装区块 */
.costume-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.costume-layout {
  display: flex; flex-wrap: wrap;
  gap: 16px; align-items: flex-start;
}
.costume-arts {
  display: flex; gap: 10px; align-items: flex-end; flex-shrink: 0;
}
.scene-fig img  { max-height: 180px; width: auto; }
.costume-items  { align-self: center; }

/* 行内单品 / 尤提姆图片（固定 68×68，object-fit:contain 维持比例） */
.item-inline-img {
  float: left;
  width: 68px;
  height: 68px;
  object-fit: contain;
  object-position: center;
  background: var(--bg-elevated); /* 补白填充空白区 */
  margin: 2px 14px 4px 0;
  cursor: zoom-in;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: opacity .15s;
  display: block;
  flex-shrink: 0;
}
.item-inline-img:hover { opacity: .82; }

/* 含行内图的 li 建立独立格式化上下文，防止浮动溢出至相邻条目 */
article li:has(.item-inline-img) {
  overflow: hidden;
}

/* 移动端：立绘允许单列换行 */
@media (max-width: 768px) {
  .portraits-row { flex-wrap: wrap; }
  .portrait-fig img { max-height: 160px; }
  .item-fig img { max-height: 70px; }
  .scene-fig img { max-height: 130px; }
  .item-inline-img { width: 52px; height: 52px; margin-right: 8px; }
}

/* === 滚动条美化 === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c0c0c0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }

/* === 选中高亮 === */
::selection { background: rgba(30, 58, 138, 0.12); }
