:root{--fg:#222;--muted:#777;--line:#eee;--accent:#c00}
*{box-sizing:border-box}
body{margin:0;font:16px/1.8 -apple-system,"Segoe UI","Microsoft YaHei",sans-serif;color:var(--fg);background:#fff}
.wrap{max-width:95%;width: 100%;margin:0 auto;padding:24px 18px 60px}/* 桌面上限 手机上撑满 */
h1{color:#5e1414;font-size:28px;line-height:1.4;margin:12px 0}
h2.subtitle{color:#8a5a5a;font-size:18px;line-height:1.5;font-weight:normal;margin:-6px 0 14px}
.meta{color:var(--muted);font-size:14px;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:20px}
.meta span{margin-right:16px}
.content p, section{margin:0 0 1em;text-indent:2em}
.content img{max-width:100%;height:auto;display:block;margin:0 auto}
.content blockquote{border-left:3px solid var(--accent);margin:1em 0;padding:.2em 1em;color:#555;background:#fafafa}
.content pre{background:#f6f6f6;padding:12px;overflow:auto;border-radius:6px}
/* 注释级：注、备注、摘要、参考资料等，只用小一号字体 */
.content .note{font-size:14px;line-height:1.7;color:#777;text-indent:0;margin:0 0 1em}
img{ max-width: 100%; height: auto; }
p, li, td, code{ overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 600px){
  h1{ font-size: 22px; }
  h2{ font-size: 18px; margin-top: 28px; }
  .wrap{ padding: 20px 14px 48px; }
  th, td{ padding: 6px 8px; font-size: 14px; }
}

/* ===== 表格 ===== */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.table-wrapper table {
    width: 100%;
    table-layout: fixed;        /* 列宽只由表头 <col> 决定，后续各行零参数 */
    border-collapse: collapse;
    font-size: 13px;
}
.table-wrapper th,
.table-wrapper td {
    border: 1px solid #888;
    padding: 6px 8px;
    text-align: left;
    word-wrap: break-word;
}
/* 表头：旧文章的 thead 行；新简化格式没有 thead，首行即表头（两种都染成深红底白字） */
.table-wrapper thead > tr > th,
.table-wrapper thead > tr > td {
    background: #8B0000 !important;
    color: #fff !important;
    font-weight: bold;
    text-align: center;
}
.table-wrapper table:not(:has(thead)) tbody > tr:first-child > td,
.table-wrapper table:not(:has(thead)) > tr:first-child > td {
    background: #8B0000 !important;
    color: #fff !important;
    font-weight: bold;
    text-align: center;
}
.table-wrapper td:first-child { text-align: center; }
.table-wrapper td font { font-size: inherit; color: inherit; }
.table-wrapper td a { color: #8B4513; text-decoration: none; }


/* ===== 斑马纹：表头深红不动，正文奇偶交替 ===== */
.table-wrapper tbody > tr:nth-child(odd)  > td { background: #f2ede8; } /* 第1、3、5…行：白底 */
.table-wrapper tbody > tr:nth-child(even) > td { background: #ffffff; } /* 第2、4、6…行：浅米灰 */

/* 悬停色浅蓝色（取一个介于两者之间的稍深色，确保明显） */
.table-wrapper tbody > tr:hover > td { background: #dbe9f8; }

/* ===== 当前位置、上下篇、相关阅读 ===== */
.article-breadcrumb{margin:0 0 16px;color:var(--muted);font-size:14px;line-height:1.6}
.article-breadcrumb a,.article-prev-next a,.related-reading a,
.article-breadcrumb a:visited,.article-prev-next a:visited,.related-reading a:visited,
.article-breadcrumb a:hover,.article-prev-next a:hover,.related-reading a:hover,
.article-breadcrumb a:active,.article-prev-next a:active,.related-reading a:active{color:#999;text-decoration:none}
.breadcrumb-separator{margin:0 5px;color:#aaa}
.article-prev-next{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:28px;padding:18px 0;border-top:1px solid #d8c8c8;border-bottom:1px solid var(--line);font-size:14px;line-height:1.7}
.article-prev,.article-next{min-width:0;overflow-wrap:anywhere}
.article-next{text-align:right}
.nav-empty{color:#999}
.related-reading{margin-top:24px}
.related-reading h2{margin:0 0 10px;color:#5e1414;font-size:20px;line-height:1.4}
.related-reading ul{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 24px}
.related-reading li{min-width:0;padding-left:14px;position:relative;font-size:14px;line-height:1.7;overflow-wrap:anywhere}
.related-reading li::before{content:"";position:absolute;left:0;top:.72em;width:4px;height:4px;border-radius:50%;background:#8b0000}
@media (max-width:600px){
  .article-prev-next,.related-reading ul{grid-template-columns:1fr}
  .article-next{text-align:left}
}
