:root {
  --brand: #f98701;
  --brand-dark: #c96a00;
  --ink: #20262e;
  --text: #333b45;
  --muted: #6b7785;
  --line: #e6e9ee;
  --bg: #f6f7f9;
  --card: #fff;
  --link: #0b5cb8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; font-size: 17px; line-height: 1.85; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid #ffb04d; outline-offset: 2px; }

.b-wrap { max-width: 1032px; margin: 0 auto; padding: 0 16px; } /* 內容寬 1000px，與全站一致 */

/* 頁首：顏色、尺寸與全站頁首一致（對應 theme4s.css 的 .kj519_header / .kj519_nav / .notic_nav） */
.b-header { background: #ff9a1f url("/96/res/themes/images/site4/kj519_header_bg.jpg") repeat-x; color: #fff; }
.b-header-in { display: flex; align-items: center; justify-content: space-between; height: 67px; }
.b-logo { display: inline-flex; align-items: center; }
.b-logo img { display: block; width: 192px; height: 49px; }
.b-menu-btn { display: none; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.6); color: #fff; border-radius: 8px; padding: 6px 14px; font-size: 1rem; font-family: inherit; cursor: pointer; }
.b-nav { background: #fc8800; border-top: 1px solid #e46b00; }
.b-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.b-nav a { display: block; height: 32px; line-height: 32px; padding: 0 25px; color: #fff; font-size: 16px; }
.b-nav a:hover, .b-nav a.on { background: #e46b00; text-decoration: none; }
.b-notice { background: #f3f3f3 url("/96/res/themes/images/site4/hj_public_head_bg.jpg") repeat-x bottom; color: #b90000; }
.b-notice .b-wrap { height: 37px; line-height: 37px; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 41px; background: url("/96/res/themes/images/site4/hj_public_head_AIcon.jpg") no-repeat 16px 11px; }

/* 版面 */
.b-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; padding-top: 22px; padding-bottom: 48px; }
.b-main { min-width: 0; }
.b-crumb { font-size: .9rem; color: var(--muted); margin-bottom: 10px; }
.b-crumb span { margin: 0 6px; }
.b-title { font-size: 1.9rem; line-height: 1.35; margin: 0 0 10px; color: var(--ink); }
.b-lead { color: var(--muted); margin: 0 0 18px; }
.b-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.b-tag { display: inline-block; padding: 1px 10px; border-radius: 100px; background: #fff1de; color: var(--brand-dark); font-size: .85rem; }

/* 篩選列 */
.b-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.b-filter > a { padding: 4px 14px; border: 1px solid var(--line); border-radius: 100px; background: #fff; color: var(--text); font-size: .95rem; }
.b-filter > a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.b-search { margin-left: auto; display: flex; gap: 6px; }
.b-search input { width: 170px; padding: 6px 10px; border: 1px solid #cdd4db; border-radius: 8px; font-size: .95rem; font-family: inherit; }
.b-search button { padding: 6px 14px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-family: inherit; font-size: .95rem; cursor: pointer; }

/* 文章卡片 */
.b-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.b-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.b-card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.b-card-body { padding: 16px 18px 18px; }
.b-card h2 { font-size: 1.15rem; line-height: 1.5; margin: 8px 0 6px; }
.b-card h2 a { color: var(--ink); }
.b-card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.7; }
.b-empty { background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; }

.b-pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.b-pager a, .b-pager strong { min-width: 40px; text-align: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.b-pager strong { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 文章頁 */
.b-article { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px 30px 30px; }
.b-cover { width: 100%; border-radius: 10px; margin: 16px 0 4px; }
.b-toc { margin: 20px 0; padding: 14px 18px; background: #fff8ee; border: 1px solid #ffe3bd; border-radius: 10px; font-size: .97rem; }
.b-toc ol { margin: 6px 0 0; padding-left: 1.4em; }
.b-content { margin-top: 18px; overflow-wrap: anywhere; }
.b-content h2 { font-size: 1.4rem; line-height: 1.45; color: var(--ink); margin: 2em 0 .6em; padding-left: 12px; border-left: 5px solid var(--brand); scroll-margin-top: 16px; }
.b-content h3 { font-size: 1.15rem; color: var(--ink); margin: 1.6em 0 .4em; }
.b-content p { margin: 0 0 1.1em; }
.b-content ul, .b-content ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.b-content li { margin-bottom: .35em; }
.b-content blockquote { margin: 1.2em 0; padding: 10px 16px; border-left: 4px solid #cdd4db; background: #f6f7f9; color: #4a5562; }
.table-scroll { overflow-x: auto; margin: 0 0 1.2em; }
.b-content table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: .96rem; }
.b-content th, .b-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.b-content th { background: #fff4e3; color: var(--ink); white-space: nowrap; }
.b-content tr:nth-child(even) td { background: #fbfbfc; }
.b-tags { margin: 22px 0 0; font-size: .93rem; color: var(--muted); }
.b-tags a { display: inline-block; margin: 0 6px 6px 0; padding: 1px 10px; border: 1px solid var(--line); border-radius: 100px; color: var(--text); }
.b-disclaimer { margin: 20px 0 0; padding: 12px 16px; background: #f6f7f9; border-radius: 10px; font-size: .9rem; color: var(--muted); line-height: 1.7; }
.b-neighbors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.b-neighbors a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); line-height: 1.5; font-size: .97rem; }
.b-neighbors a span { display: block; font-size: .82rem; color: var(--muted); }
.b-neighbors a.next { text-align: right; grid-column: 2; }
.b-related { margin-top: 28px; }
.b-related h2 { font-size: 1.2rem; margin: 0 0 10px; color: var(--ink); }
.b-related ul { list-style: none; margin: 0; padding: 0; }
.b-related li { padding: 12px 0; border-top: 1px solid var(--line); }
.b-related li a { font-weight: 700; }
.b-related li p { margin: 4px 0 0; font-size: .93rem; color: var(--muted); line-height: 1.6; }

/* 側邊欄 */
.b-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.b-box h2 { font-size: 1.05rem; margin: 0 0 8px; color: var(--ink); }
.b-box ul, .b-box ol { margin: 0; padding: 0; list-style: none; }
.b-cats a { display: flex; justify-content: space-between; padding: 6px 0; color: var(--text); }
.b-cats span { color: var(--muted); font-size: .9rem; }
.b-pop { counter-reset: pop; }
.b-pop li { counter-increment: pop; position: relative; padding: 7px 0 7px 30px; border-top: 1px solid var(--line); font-size: .95rem; line-height: 1.55; }
.b-pop li:first-child { border-top: 0; }
.b-pop li::before { content: counter(pop); position: absolute; left: 0; top: 8px; width: 22px; height: 22px; border-radius: 6px; background: #fff1de; color: var(--brand-dark); font-size: .82rem; line-height: 22px; text-align: center; font-weight: 700; }
.b-games { display: flex; flex-wrap: wrap; gap: 6px; }
.b-games a { display: block; padding: 3px 12px; border: 1px solid var(--line); border-radius: 100px; font-size: .92rem; color: var(--text); }

.b-footer { background: var(--ink); color: #c5ccd4; font-size: .9rem; line-height: 1.7; padding: 22px 0; }
.b-footer a { color: #fff; }
.b-footer p { margin: 0 0 6px; }

@media (max-width: 900px) {
  .b-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .b-menu-btn { display: block; }
  .b-nav { display: none; }
  .b-nav.open { display: block; }
  .b-nav ul { display: grid; grid-template-columns: 1fr 1fr; }
  .b-nav a { height: auto; line-height: 1.5; padding: 10px 16px; }
  .b-header-in { height: 56px; }
  .b-logo img { width: 157px; height: 40px; }
  .b-notice .b-wrap { height: auto; line-height: 1.5; font-size: 14px; white-space: normal; padding: 6px 16px; background-image: none; }
  .b-title { font-size: 1.5rem; }
  .b-article { padding: 18px 16px 22px; border-radius: 0; border-left: 0; border-right: 0; margin: 0 -16px; }
  .b-content h2 { font-size: 1.25rem; }
  .b-search { margin-left: 0; width: 100%; }
  .b-search input { flex: 1; width: auto; }
  .b-grid { grid-template-columns: 1fr; }
  .b-neighbors { grid-template-columns: 1fr; }
  .b-neighbors a.next { grid-column: 1; text-align: left; }
}

/* 網站地圖頁 */
.sm-list { list-style: none; margin: 0; padding: 0; font-size: .95rem; line-height: 1.6; }
.sm-list li { padding: 4px 0; border-top: 1px solid var(--line); }
.sm-list li:first-child { border-top: 0; }
