/* HanHan's 寵物窩 Wiki — MediaWiki 風格 skin */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: #f8f9fa; color: #202122;
  font-family: "PingFang TC","Microsoft JhengHei","Noto Sans TC","Heiti TC",sans-serif;
  font-size: 15px; line-height: 1.7;
}
a { color: #3366cc; text-decoration: none; }
a:visited { color: #6b4ba1; }
a:hover { text-decoration: underline; }

/* header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border-bottom: 1px solid #a2a9b1; padding: 10px 20px;
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; color: #202122; }
.logo:hover { text-decoration: none; }
.logo-icon { font-size: 30px; }
.logo-text { font-size: 20px; font-weight: 700; line-height: 1.2; }
.logo-text small { display: block; font-size: 12px; font-weight: 400; color: #54595d; }
.search { display: flex; gap: 6px; }
.search input {
  border: 1px solid #a2a9b1; border-radius: 2px; padding: 6px 10px;
  width: 240px; font-size: 14px; background: #fff;
}
.search button {
  border: 1px solid #a2a9b1; background: #f8f9fa; border-radius: 2px;
  padding: 6px 14px; cursor: pointer; font-size: 14px;
}
.search button:hover { background: #eaecf0; }

/* layout */
.layout { display: flex; max-width: 1280px; margin: 0 auto; }
.sidebar {
  width: 265px; flex-shrink: 0; padding: 16px 12px 40px 16px;
  font-size: 13px;
}
.nav-sec { margin-bottom: 14px; }
.nav-sec-title { display: block; font-weight: 700; margin-bottom: 4px; color: #202122; }
.nav-sec ul { list-style: none; margin: 0; padding: 0; border-left: 3px solid #eaecf0; }
.nav-sec li a { display: block; padding: 2px 8px; color: #3366cc; border-radius: 2px; }
.nav-sec li a.cur { background: #eaecf0; font-weight: 700; color: #202122; }

.content {
  flex: 1; min-width: 0; background: #fff; border: 1px solid #c8ccd1;
  border-left: none; margin: 0; padding: 24px 36px 40px;
}
.crumbs { font-size: 13px; color: #54595d; margin-bottom: 8px; }
h1 {
  font-family: "Noto Serif TC","PMingLiU",serif; font-weight: 400;
  font-size: 28px; margin: 0 0 4px; border-bottom: 1px solid #a2a9b1; padding-bottom: 6px;
}
.subtitle { color: #54595d; font-size: 13px; margin-bottom: 18px; }

/* TOC */
.toc {
  display: inline-block; min-width: 280px; max-width: 100%;
  background: #f8f9fa; border: 1px solid #a2a9b1; padding: 10px 18px 12px;
  margin: 6px 0 20px; font-size: 14px;
}
.toc-title { font-weight: 700; text-align: center; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 28px; }
.toc li { margin: 2px 0; }

/* article */
.article-body { max-width: 900px; }
.article-body p { margin: 0.7em 0; }
.article-body img { max-width: 100%; height: auto; border: 1px solid #c8ccd1; background: #fff; }
.article-body table { border-collapse: collapse; max-width: 100%; margin: 10px 0; }
.article-body td, .article-body th { border: 1px solid #a2a9b1; padding: 5px 9px; vertical-align: top; }
.article-body th, .article-body table th { background: #eaecf0; }
.article-body hr.divider {
  border: none; border-top: 2px dotted #c8ccd1; margin: 26px 0;
}
.article-body blockquote {
  border-left: 3px solid #c8ccd1; margin: 10px 0 10px 12px; padding: 2px 14px; color: #3a3f44; background: #f8f9fa;
}
.hl-red { color: #d33; }
.hl-green { color: #157a15; }
.hl-blue { color: #36c; }
.xref { color: #72777d; font-size: 13px; }
.img-missing {
  display: inline-block; background: #fee7e6; border: 1px dashed #b32424; color: #b32424;
  font-size: 12px; padding: 1px 6px; border-radius: 2px; margin: 2px;
}

/* footer */
.page-footer { margin-top: 34px; border-top: 1px solid #c8ccd1; padding-top: 12px; font-size: 13px; color: #54595d; }
.page-footer .copy { margin-top: 6px; }

/* main page */
.hero { text-align: center; padding: 18px 0 8px; }
.hero h1 { border: none; font-size: 34px; }
.hero p { max-width: 720px; margin: 10px auto; color: #3a3f44; }
.notice {
  background: #ecf4ff; border: 1px solid #3366cc33; border-radius: 4px;
  padding: 12px 20px; margin: 18px 0 26px; font-size: 14px;
}
.notice ul { margin: 8px 0 0; padding-left: 22px; }
.cat { margin: 26px 0; }
.cat h2 {
  font-family: "Noto Serif TC","PMingLiU",serif; font-weight: 400; font-size: 23px;
  border-bottom: 1px solid #a2a9b1; padding-bottom: 4px;
}
.cat-desc { color: #3a3f44; }
.cat-table { width: 100%; max-width: 760px; }
.cat-table td { border: none !important; border-bottom: 1px solid #eaecf0 !important; padding: 5px 4px !important; }
.cat-table .td-meta { color: #72777d; font-size: 12px; width: 70px; text-align: right; }

/* search result */
.search-result {
  background: #fef6e7; border: 1px solid #cdab4a; border-radius: 4px;
  padding: 12px 20px; margin: 14px 0;
}
.search-result h2 { margin: 4px 0 8px; font-size: 18px; border: none; }
.search-result li { margin: 6px 0; }
.search-result .sr-sec { color: #72777d; font-size: 12px; }
.search-result .sr-x { color: #54595d; font-size: 13px; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; order: 2; }
  .content { border-left: 1px solid #c8ccd1; padding: 16px; }
  .search input { width: 160px; }
}
