:root {
  color-scheme: light;
  --bg: #f4f6f6; --surface: #fff; --soft: #edf1f0;
  --ink: #202a29; --muted: #667471; --line: #dbe2df;
  --accent: #28675a; --accent-soft: #e1eee8; --notice: #416b91;
  --header: 72px; --side: 250px;
  font-family: "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  letter-spacing: 0;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161a19; --surface: #202625; --soft: #2b3330;
  --ink: #e7eeeb; --muted: #a5b4ae; --line: #3b4641;
  --accent: #94cbb7; --accent-soft: #30463e; --notice: #9bbedd;
}
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.75; }
a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); cursor: pointer; }
button:hover { background: var(--soft); }
input { min-width: 0; max-width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, h4, p { margin-top: 0; overflow-wrap: anywhere; }
h1 { font-size: 27px; line-height: 1.45; margin-bottom: 9px; }
h2 { font-size: 19px; line-height: 1.5; margin-bottom: 14px; }
h3 { font-size: 16px; }
small, .muted { color: var(--muted); }
svg, [data-lucide] { width: 18px; height: 18px; flex: 0 0 18px; stroke-width: 1.7; }
.icon-button { width: 36px; height: 36px; flex: 0 0 36px; padding: 8px; border-color: transparent; background: transparent; }
.icon-button:hover { border-color: var(--line); }
.mobile-only { display: none; }
.skip-link { position: fixed; left: 12px; top: 8px; padding: 10px 16px; transform: translateY(-160%); z-index: 90; background: var(--surface); border: 2px solid var(--accent); }
.skip-link:focus { transform: none; }
.topbar { height: var(--header); position: fixed; inset: 0 0 auto; z-index: 40; display: flex; align-items: center; gap: 24px; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 205px; color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1.35; }
.brand:hover { text-decoration: none; }
.brand img { width: 35px; height: 44px; object-fit: contain; }
.brand small { display: block; font-size: 11px; font-weight: 400; margin-top: 3px; }
#search-form { display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; max-width: 560px; padding-left: 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); }
#search-form:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
#search { flex: 1; width: 100%; padding: 7px 1px; font-size: 13px; background: transparent; border: 0; outline: 0; }
#theme { margin-left: auto; }
#sidebar { position: fixed; inset: var(--header) auto 0 0; width: var(--side); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; }
#nav { padding: 18px 12px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
#nav a { display: flex; align-items: flex-start; gap: 10px; padding: 10px; margin-bottom: 3px; color: var(--muted); font-size: 13px; line-height: 1.6; border-radius: 4px; }
#nav a svg { margin-top: 2px; }
#nav a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
#nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
#nav .nav-top { color: var(--ink); font-size: 14px; }
#nav .updates-nav { margin-bottom: 12px; }
.category-group { margin: 0 0 30px; }
.category-group > h2 { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.announcement-history { border-top: 1px solid var(--line); }
.nav-label { font-size: 11px; color: var(--muted); margin: 20px 10px 9px; }
.nav-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
#sidebar footer { padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
#updated { display: block; margin-top: 4px; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); }
#main { min-width: 0; margin-left: var(--side); padding: calc(var(--header) + 32px) 36px 60px; min-height: 100vh; max-width: 1700px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading > div { min-width: 0; }
.page-heading p { color: var(--muted); margin-bottom: 0; font-size: 13px; }
.page-heading button { flex-shrink: 0; }
.eyebrow { color: var(--accent); font-size: 12px; margin-bottom: 6px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 17px; }
.home-navigation { border-top: 1px solid var(--line); }
.latest-announcement { margin-bottom: 28px; }
.latest-announcement > h2 { display: flex; align-items: center; gap: 8px; }
.latest-announcement > time { display: block; color: var(--muted); font-size: 12px; margin-bottom: 18px; }
.announcement-body { max-width: 1050px; }
.band { min-width: 0; border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: 30px; }
.section-heading { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-heading h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.section-heading > a { font-size: 12px; flex-shrink: 0; }
.announcement h2 svg { color: var(--notice); }
.article-list, .catalog-grid { list-style: none; padding: 0; margin: 0; }
.article-list > li { border-bottom: 1px solid var(--line); }
.article-link { display: flex; align-items: center; gap: 14px; padding: 16px 0; color: var(--ink); }
.article-link:hover { text-decoration: none; color: var(--accent); }
.article-link > div { flex: 1; min-width: 0; }
.article-link strong { font-size: 15px; overflow-wrap: anywhere; }
.article-link p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 5px 0 0; }
.article-link .nav-summary { max-width: 70ch; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.article-link small { display: block; font-size: 11px; margin-bottom: 3px; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.catalog-grid a { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 18px 0; color: var(--ink); }
.catalog-grid a span:nth-child(2) { flex: 1; min-width: 0; }
.empty { color: var(--muted); padding: 22px 0; margin: 0; }
mark { background: var(--accent-soft); color: var(--accent); border-radius: 2px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 36px; align-items: start; }
.article-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.article-body { grid-column: 1; grid-row: 1; min-width: 0; max-width: 100%; font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
.article-body > :first-child { margin-top: 0; }
.article-body :is(h1,h2,h3,h4,h5,h6) { line-height: 1.55; margin-top: 30px; margin-bottom: 14px; }
.article-body h1 { font-size: 25px; }
.article-body h2 { font-size: 21px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.article-body h3 { font-size: 18px; }
.article-body :is(h4,h5,h6) { font-size: 15px; }
.article-body [id], .page-heading h1[id], #main { scroll-margin-top: calc(var(--header) + 24px); }
.article-body [tabindex="-1"]:focus { outline: none; }
.article-body [tabindex="-1"]:focus-visible { outline: 2px solid var(--accent); }
.article-body img, .article-body video { max-width: 100%; height: auto; }
.article-body :is(ul,ol) { padding-left: 24px; }
.article-body blockquote { margin: 22px 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.article-body blockquote > :last-child { margin-bottom: 0; }
.article-body pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; background: var(--soft); border-radius: 4px; max-width: 100%; }
.article-body code { font-family: Consolas, monospace; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.table-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; margin: 20px 0; border: 1px solid var(--line); background: var(--surface); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.7; margin: 0; }
.article-body th, .article-body td { min-width: 112px; padding: 11px 13px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.article-body th { background: var(--soft); font-weight: 700; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body tbody tr:nth-child(even) { background: var(--bg); }
.article-body caption { padding: 10px 13px; text-align: left; color: var(--muted); }
.toc { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header) + 24px); max-height: calc(100dvh - var(--header) - 48px); overflow-y: auto; border-left: 1px solid var(--line); padding-left: 18px; font-size: 12px; overscroll-behavior: contain; }
.toc summary { cursor: pointer; font-weight: 700; color: var(--ink); padding-bottom: 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a { display: block; padding: 6px 8px; color: var(--muted); border-radius: 3px; overflow-wrap: anywhere; }
.toc a:hover, .toc a[aria-current="location"] { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.toc .toc-nested a { padding-left: 20px; }
.toc .toc-deep a { padding-left: 30px; }
.article-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; border-top: 1px solid var(--line); margin-top: 36px; padding-top: 20px; }
.article-pagination a { display: flex; align-items: center; gap: 12px; min-width: 0; }
.article-pagination a:last-child { grid-column: 2; text-align: right; justify-content: flex-end; }
.article-pagination a:first-child:not(:last-child) { grid-column: 1; }
.article-pagination .previous { grid-column: 1 !important; text-align: left !important; justify-content: flex-start !important; }
.article-pagination span { min-width: 0; overflow-wrap: anywhere; }
.article-pagination small { display: block; font-size: 12px; }
#toast { position: fixed; bottom: 22px; right: 22px; left: auto; max-width: min(440px, calc(100% - 44px)); padding: 12px 18px; background: var(--ink); color: var(--surface); border-radius: 5px; z-index: 90; box-shadow: 0 3px 15px #0002; overflow-wrap: anywhere; }
dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #0007; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dialog-head h2 { margin: 0; }
#copy-url { display: block; width: 100%; margin: 6px 0 12px; }
#copy-status { font-size: 12px; color: var(--muted); margin: 0; }
.noscript { position: fixed; bottom: 0; left: 0; right: 0; padding: 16px; background: var(--surface); z-index: 50; }
@media (max-width: 1200px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .toc { grid-column: 1; grid-row: 1; position: static; max-height: 280px; padding: 12px 0 12px 16px; }
  .article-body { grid-row: 2; }
  #main { padding-left: 24px; padding-right: 24px; }
  .topbar { gap: 15px; padding: 0 14px; }
  .brand { flex-basis: 220px; }
}
@media (max-width: 760px) {
  :root { --header: 120px; --side: 286px; }
  .mobile-only { display: inline-flex; }
  .topbar { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; grid-template-rows: 58px 50px; gap: 0 8px; padding: 0 12px 12px; }
  .brand { min-width: 0; font-size: 18px; gap: 8px; }
  .brand img { width: 27px; height: 36px; }
  .brand small { font-size: 10px; }
  #theme { grid-column: 3; grid-row: 1; }
  #search-form { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  #sidebar { inset: 0 auto 0 0; width: min(var(--side), calc(100% - 40px)); z-index: 60; visibility: hidden; transform: translateX(-100%); }
  body.nav-open #sidebar { transform: none; visibility: visible; }
  body.nav-open { overflow: hidden; }
  .sidebar-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  #backdrop { position: fixed; inset: 0; background: #0006; z-index: 50; }
  #main { margin-left: 0; padding: calc(var(--header) + 22px) 18px 40px; }
  h1 { font-size: 24px; }
  .page-heading { flex-wrap: wrap; gap: 12px; }
  .home-columns, .catalog-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .article-body { font-size: 14px; }
  .article-body h1 { font-size: 23px; }
  .article-body h2 { font-size: 20px; }
  .article-pagination { gap: 16px; font-size: 13px; }
}
@media print {
  .topbar, #sidebar, .toc, .page-heading button, .article-pagination, #toast, .skip-link, #backdrop { display: none !important; }
  #main { margin: 0; padding: 0; max-width: none; }
  .article-layout { display: block; }
  .table-scroll { overflow: visible; border: 0; }
  .article-body th, .article-body td { min-width: 0; padding: 4px; }
  body { background: #fff; color: #000; }
}
