/* Default css file for jemdoc. */

/*
table#tlayout {
    border: none;
    border-collapse: separate;
    background: white;
}*/



body {
    background: #2c2c2c;   /* 深色背景，#111 / #222 / #333 都可以 */
    margin: 0;
    padding: 0;
}

/* 整个页面表格居中 */
table#tlayout {
    border: none;
    border-collapse: separate;
    background: #fff;         /* 保持内容区是白色 */
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);  /* 内容浮在深色背景上 */
	border-radius: 8px;
    overflow: hidden; /* 避免圆角被表格内容撑破 */
}

#layout-menu {
	background: #f6f6f6;
	border: 1px solid #dddddd;
	padding-top: 0.5em;
	padding-left: 8px;
	padding-right: 8px;
	font-size: 1.0em;
	width: auto;
	white-space: nowrap;
    text-align: left;
    vertical-align: top;
}

#layout-menu td {
	background: #f4f4f4;
    vertical-align: top;
}

#layout-content {
    max-width: 1400px;   /* 设置一个最大宽度，比如900像素，可以根据喜好调整 */
    margin: 0 auto;     /* 自动居中 */
    padding: 20px;      /* 内边距保留，避免文字贴边 */
    background: #f7f7f7;   /* 可以选，给个白底 */
	border: none;
	text-align: left;
	vertical-align: top;
}

/* #layout-content {
/*	padding-top: 0.0em;
/*	padding-left: 1.0em;
/*	padding-right: 1.0em;
/*    border: none;
/*    background: white;
/*    text-align: left;
/*    vertical-align: top;
/*}

#layout-menu a {
	line-height: 1.5em;
	margin-left: 0.5em;
}

tt {
    background: #ffffdd;
}

pre, tt {
	font-size: 90%;
	font-family: monaco, monospace;
}

a, a > tt {
	color: #224b8d;
	text-decoration: none;
}

a:hover {
	border-bottom: 1px gray dotted;
}

#layout-menu a.current:link, #layout-menu a.current:visited {
	color: #022b6d;
	border-bottom: 1px gray solid;
}
#layout-menu a:link, #layout-menu a:visited, #layout-menu a:hover {
	color: #527bbd;
	text-decoration: none;
}
#layout-menu a:hover {
	text-decoration: none;
}

div.menu-category {
	border-bottom: 1px solid gray;
	margin-top: 0.8em;
	padding-top: 0.2em;
	padding-bottom: 0.1em;
	font-weight: bold;
}

div.menu-item {
	padding-left: 16px;
	text-indent: -16px;
}

div#toptitle {
	padding-bottom: 0.2em;
	margin-bottom: 1.5em;
	border-bottom: 3px double gray;
}

/* Reduce space if we begin the page with a title. */
div#toptitle + h2, div#toptitle + h3 {
	margin-top: -0.7em;
}

div#subtitle {
	margin-top: 0.0em;
	margin-bottom: 0.0em;
	padding-top: 0em;
	padding-bottom: 0.1em;
}

em {
	font-style: italic;
}

strong {
	font-weight: bold;
}


h1, h2, h3 {
	color: #527bbd;
	margin-top: 0.7em;
	margin-bottom: 0.3em;
	padding-bottom: 0.2em;
	line-height: 1.0;
	padding-top: 0.5em;
	border-bottom: 1px solid #aaaaaa;
}

h1 {
	font-size: 165%;
}

h2 {
	padding-top: 0.8em;
	font-size: 125%;
}

h2 + h3 {
    padding-top: 0.2em;
}

h3 {
	font-size: 110%;
	border-bottom: none;
}

p {
	margin-top: 0.0em;
	margin-bottom: 0.8em;
	padding: 0;
	line-height: 1.3;
}

pre {
	padding: 0;
	margin: 0;
}

div#footer {
	font-size: small;
	border-top: 1px solid #c0c0c0;
	padding-top: 0.1em;
	margin-top: 4.0em;
	color: #c0c0c0;
}

div#footer a {
	color: #80a0b0;
}

div#footer-text {
	float: left;
	padding-bottom: 8px;
}

ul, ol, dl {
	margin-top: 0.2em;
	padding-top: 0;
	margin-bottom: 0.8em;
}

dt {
	margin-top: 0.5em;
	margin-bottom: 0;
}

dl {
	margin-left: 20px;
}

dd {
	color: #222222;
}

dd > *:first-child {
	margin-top: 0;
}

ul {
	list-style-position: outside;
	list-style-type: square;
}

p + ul, p + ol {
	margin-top: -0.5em;
}

li ul, li ol {
	margin-top: -0.3em;
}

ol {
	list-style-position: outside;
	list-style-type: decimal;
}

li p, dd p {
	margin-bottom: 0.3em;
}


ol ol {
	list-style-type: lower-alpha;
}

ol ol ol {
	list-style-type: lower-roman;
}

p + div.codeblock {
	margin-top: -0.6em;
}

div.codeblock, div.infoblock {
	margin-right: 0%;
	margin-top: 1.2em;
	margin-bottom: 1.3em;
}

div.blocktitle {
	font-weight: bold;
	color: #cd7b62;
	margin-top: 1.2em;
	margin-bottom: 0.1em;
}

div.blockcontent {
	border: 1px solid silver;
	padding: 0.3em 0.5em;
}

div.infoblock > div.blockcontent {
	background: #ffffee;
}

div.blockcontent p + ul, div.blockcontent p + ol {
	margin-top: 0.4em;
}

div.infoblock p {
	margin-bottom: 0em;
}

div.infoblock li p, div.infoblock dd p {
	margin-bottom: 0.5em;
}

div.infoblock p + p {
	margin-top: 0.8em;
}

div.codeblock > div.blockcontent {
	background: #f6f6f6;
}

span.pycommand {
	color: #000070;
}

span.statement {
	color: #008800;
}
span.builtin {
	color: #000088;
}
span.special {
	color: #990000;
}
span.operator {
	color: #880000;
}
span.error {
	color: #aa0000;
}
span.comment, span.comment > *, span.string, span.string > * {
	color: #606060;
}

@media print {
	#layout-menu { display: none; }
}

#fwtitle {
	margin: 2px;
}

#fwtitle #toptitle {
	padding-left: 0.5em;
	margin-bottom: 0.5em;
}

#layout-content h1:first-child, #layout-content h2:first-child, #layout-content h3:first-child {
	margin-top: -0.7em;
}

div#toptitle h1, #layout-content div#toptitle h1 {
	margin-bottom: 0.0em;
	padding-bottom: 0.1em;
	padding-top: 0;
	margin-top: 0.5em;
	border-bottom: none;
}

img.eq {
	padding: 0;
	padding-left: 0.1em;
	padding-right: 0.1em;
	margin: 0;
}

img.eqwl {
	padding-left: 2em;
	padding-top: 0.6em;
	padding-bottom: 0.2em;
	margin: 0;
}

table {
    border: 2px solid black;
    border-collapse: collapse;
}

td {
    padding: 2px;
    padding-left: 0.5em;
    padding-right: 0.5em;
    text-align: center;
    border: 1px solid gray;
}

table + table {
    margin-top: 1em;
}

tr.heading {
    font-weight: bold;
    border-bottom: 2px solid black;
}

img {
    border: none;
}

table.imgtable, table.imgtable td {
    border: none;
    text-align: left;
}


/* 统一“白色卡片”的最大宽度并居中显示 */
table#tlayout {
  max-width: 1100px;   /* 统一上限：可改 900/1000/1100 按喜好 */
  width: 100%;         /* 小屏下自适应 */
  margin-left: auto;
  margin-right: auto;
  /* 你已有的属性保留：背景、阴影、圆角、overflow 等 */
}

/* 固定侧栏宽度，避免因文字过长而把页面撑宽 */
td#layout-menu, #layout-menu {  /* 两种写法都覆盖到 */
  width: 120px;             /* 你可以改 200~260 之间 */
  white-space: normal;      /* 允许换行（原来是 nowrap） */
  word-break: break-word;   /* 长单词/链接也能断行 */
}

/* 内容区不再设置过大的 max-width（让它跟随整体 tlayout） */
td#layout-content, #layout-content {
  max-width: none;          /* 取消 1200px 上限，避免比 tlayout 还宽 */
  padding: 20px;
}

/* 防止任何页面被长内容撑宽 */
#layout-content, body, html {
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
}

/* 媒体与表格在容器内缩放 */
#layout-content img,
#layout-content video,
#layout-content canvas,
#layout-content iframe,
#layout-content table {
  max-width: 100%;
  height: auto;
}

/* 代码块：更推荐横向滚动而不是强制断行（不影响排版宽度） */
pre {
  white-space: pre;
  overflow-x: auto;
}

/* === 统一页首标题分隔线（兼容有/无 #toptitle 的两种页面） === */

/* 情况 A：页面有 #toptitle（通常包含 H1 和 subtitle） */
#layout-content > #toptitle,
#fwtitle > #toptitle {
  border-bottom: 1px solid #888 !important;   /* 需要粗一点可改成 2px 或 double */
  padding-bottom: 0.5em !important;
  margin-bottom: 1.0em !important;
}

/* #toptitle 里的 H1 不要再画线，避免双线 */
#layout-content > #toptitle h1,
#fwtitle > #toptitle h1 {
  border-bottom: none !important;
  margin-bottom: 0 !important;
}

/* 情况 B：页面没有 #toptitle，用第一个标题本身画线（Group 这类页面） */
#layout-content > h1:first-of-type,
#layout-content > h2:first-of-type,
#layout-content > h3:first-of-type {
  border-bottom: 1px solid #888 !important;
  padding-bottom: 0.5em !important;
  margin-bottom: 1.0em !important;
}

/* 取消之前把标题上推的负外边距，避免分隔线“贴住/消失” */
#layout-content h1:first-child,
#layout-content h2:first-child,
#layout-content h3:first-child,
#layout-content #toptitle + h2,
#layout-content #toptitle + h3 {
  margin-top: 0.3em !important; /* 需要更松可以调到 0.6em~0.8em */
}


/* 0) 背景一定要显示出来：同时给 html 和 body，并强制覆盖 */
html, body {
  background: #2c2c2c !important; /* 换你喜欢的优雅深色也可以 */
  margin: 0 !important;
  padding: 24px 0 !important;     /* 上下留白，能看到深色边缘 */
}

/* 1) 白色卡片不要铺满：宽度自适应但不超过 max，左右居中并留出上下空隙 */
table#tlayout {
  width: auto !important;          /* 关键：不要 100% */
  max-width: 1100px !important;    /* 可改 900/1000/1100 */
  margin: 32px auto !important;    /* 上下留白 + 居中 */
  background: #fff !important;     /* 卡片白色 */
  border-radius: 8px !important;
  box-shadow: 0 0 15px rgba(0,0,0,0.3) !important;
  overflow: hidden !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: none !important;         /* 避免被全局 table 边框影响 */
}

/* 2) 内容单元背景设为透明，否则内容单元会把卡片内再次铺满灰色 */
#layout-content {
  background: transparent !important;   /* 你之前是 #f7f7f7，这会看起来像“整页还是灰的” */
  max-width: none !important;           /* 避免比 tlayout 还宽 */
  padding: 20px;
}

/* 3) 侧栏宽度按你想要的值（避免把卡片撑宽） */
td#layout-menu, #layout-menu {
  width: 120px !important;        /* 以前的窄宽度；嫌窄/宽可 100–180 之间调 */
  white-space: normal !important; /* 允许换行，避免一行很长顶宽 */
  word-break: break-word !important;
  background: #f6f6f6;            /* 保持浅灰 */
  border: 1px solid #dddddd;
}

/* 4) 全站的表格规则不要影响外层卡片（tlayout 以外保留原样） */
table {
  border: 2px solid black;
  border-collapse: collapse;
}
table#tlayout { border: none !important; border-collapse: separate !important; }

/* 5) 防“被内容撑破”——长链接/图片/表格都不超容器 */
#layout-content, body, html { overflow-wrap: anywhere; word-break: break-word; }
#layout-content img, #layout-content video, #layout-content iframe, #layout-content table {
  max-width: 100% !important; height: auto !important;
}

/* 6) 页首标题分隔线（你之前需求保留） */
#layout-content > #toptitle,
#fwtitle > #toptitle {
  border-bottom: 1px solid #888 !important;
  padding-bottom: 0.5em !important;
  margin-bottom: 1.0em !important;
}
#layout-content > #toptitle h1,
#fwtitle > #toptitle h1 { border-bottom: none !important; margin-bottom: 0 !important; }
#layout-content > h1:first-of-type,
#layout-content > h2:first-of-type,
#layout-content > h3:first-of-type {
  border-bottom: 1px solid #888 !important;
  padding-bottom: 0.5em !important;
  margin-bottom: 1.0em !important;
}
#layout-content h1:first-child,
#layout-content h2:first-child,
#layout-content h3:first-child,
#layout-content #toptitle + h2,
#layout-content #toptitle + h3 {
  margin-top: 0.3em !important;
}

/* 让深色一定可见：html 与 body 同时上色并留出上下空隙 */
html, body {
background: #555 !important;   /* 中性石墨灰，比黑色柔和 */
  margin: 0 !important;
  padding: 0 !important;
}

/* 白色卡片宽度：不再 100%，用“min(上限, 视口-左右留白)”强制居中且两侧可见背景 */
table#tlayout {
  width: min(1100px, calc(100% - 64px)) !important;  /* 上限 1100px；左右各留 32px */
  margin: 32px auto !important;                      /* 上下 32px，水平居中 */
  background: #fff !important;
  border: none !important;                           /* 防止被全局 table 边框覆盖 */
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 0 15px rgba(0,0,0,0.3) !important;
  overflow: hidden !important;
}

/* 内容区不要再自己上背景色，否则会显得整页是灰的 */
#layout-content {
  background: transparent !important;
}

/* 侧栏保持你设定的窄度（可微调） */
td#layout-menu, #layout-menu {
  width: 120px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

/* 全局表格规则不要影响外层卡片 */
table#tlayout { border: none !important; }


/* 去掉左上角的 "menu" 字样 */
.menu-category {
  display: none !important;
}

/* 调整菜单按钮右移 */
div.menu-item {
  padding-left: 24px !important;  /* 可调，20~30px 看效果 */
  text-indent: 0 !important;
}

/* 整个菜单区域整体下移一些 */
#layout-menu {
  padding-top: 1.5em !important;   /* 原来是 0.5em，可以调大，比如 2em */
}

/* 单个菜单项按钮之间增加垂直距离 */
div.menu-item {
  padding-left: 24px !important;   /* 保持之前的右移 */
  text-indent: 0 !important;
  margin-bottom: 0.8em !important; /* 增加按钮之间的间距 */
}

/* 强制全站统一为衬线字体 */
html, body, td, th, p, li, a, h1, h2, h3, h4, h5, h6 {
  font-family: "Times New Roman", Times, Georgia, "Noto Serif", "Liberation Serif", serif !important;
}

/* ======= OVERRIDES: keep original jemdoc look, only tweak layout/menus/fonts ======= */

/* 外层背景 + 上下留白（不改原有配色可换 #3a3a3a/#444c56/#555） */
html, body {
  background: #555 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 白色“卡片”不再铺满：中间居中，左右留 32px，上限 1100px */
table#tlayout {
  width: min(1100px, calc(100% - 64px)) !important;
  margin: 32px auto !important;
  background: #fff !important;
  border: none !important;                 /* 不让全局 table 边框影响外层表 */
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 0 15px rgba(0,0,0,0.3) !important;
  overflow: hidden !important;
}

/* 内容单元不再单独铺灰底，避免看起来“整页灰” */
#layout-content {
  background: transparent !important;
  padding: 20px; /* 保留舒适内边距 */
  overflow-wrap: anywhere; word-break: break-word; /* 防长链接撑宽 */
}

/* 媒体在容器内缩放（不影响你原有 imgtable 规范） */
#layout-content img,
#layout-content video,
#layout-content iframe,
#layout-content table {
  max-width: 100%;
  height: auto;
}

/* 菜单：去掉 “menu” 字样、右移、增加垂直间距、整体稍微下移、固定窄宽 */
.menu-category { display: none !important; }
#layout-menu {
  padding-top: 1.5em !important;
  width: 120px !important;
  white-space: normal !important;  /* 允许换行，避免把版面撑宽 */
}
div.menu-item {
  padding-left: 24px !important;
  text-indent: 0 !important;
  margin-bottom: 0.8em !important;
}

/* 页首标题下的分隔线：有 #toptitle 就给容器画线；否则给第一个标题画线 */
#layout-content > #toptitle {
  border-bottom: 1px solid #888 !important;
  padding-bottom: 0.5em !important;
  margin-bottom: 1.0em !important;
}
#layout-content > #toptitle h1 { border-bottom: none !important; margin-bottom: 0 !important; }

#layout-content > h1:first-of-type,
#layout-content > h2:first-of-type,
#layout-content > h3:first-of-type {
  border-bottom: 1px solid #888 !important;
  padding-bottom: 0.5em !important;
  margin-bottom: 1.0em !important;
}

/* 取消原模板里把标题“上顶”的负外边距，避免线条贴住上一块内容 */
#layout-content h1:first-child,
#layout-content h2:first-child,
#layout-content h3:first-child,
#layout-content #toptitle + h2,
#layout-content #toptitle + h3 {
  margin-top: 0.3em !important;
}

/* 统一字体（衬线体；如要无衬线把第二行换成系统 sans 栈即可） */
html, body, td, th, p, li, a, h1, h2, h3, h4, h5, h6 {
  font-family: "Times New Roman", Times, Georgia, "Noto Serif", "Liberation Serif", serif !important;
}
/* 若想无衬线风格，改为：
html, body, td, th, p, li, a, h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", sans-serif !important;
}
*/

/* ======= 修复补丁：字体 + 链接下划线 + 强调 ======= */

/* 1) 全站字体强制 Times 系（桌面 + 手机一致） */
html, body, #layout-content, #layout-content * {
  font-family: "Times New Roman", Times, Georgia, "Noto Serif", "Liberation Serif", serif !important;
}

/* iOS/Android 避免自动放大文字 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 2) 链接样式：始终带下划线，不再依赖 hover */
a, a:link, a:visited {
  text-decoration: underline !important;
  border-bottom: none !important;
}
a:hover, a:active, a:focus {
  text-decoration: underline !important;
  border-bottom: none !important;
}

/* 3) 强调文字：em = 斜体 + 下划线，strong = 粗体 + 下划线 */
em {
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 2px;
}
strong {
  font-weight: bold;
  text-decoration: underline;
  text-underline-offset: 2px;
}




