
:root {
  --sidebar-width: 304px;
  --sidebar-rail: 72px;
  --topbar-height: 64px;
  --oracle-red: #c74634;
  --oracle-red-dark: #9e3327;
  --ink: #1f2937;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --canvas: #f3f5f7;
  --sidebar: #151a22;
  --sidebar-muted: #aab4c3;
  --sidebar-hover: #232b37;
  --focus: #2f80ed;
  --code-bg: #0f172a;
  --shadow: 0 18px 48px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-height) + 18px); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: #255f9b; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--oracle-red-dark); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 14px; top: -80px; z-index: 5000; background: #fff; color: #111; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { top: 14px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1000;
  width: var(--sidebar-width); background: var(--sidebar); color: #fff;
  display: flex; flex-direction: column; transition: width .25s ease, transform .25s ease;
  box-shadow: 10px 0 30px rgba(0,0,0,.12);
}
.sidebar-header { height: var(--topbar-height); display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.08); flex: 0 0 auto; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.brand:hover { color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--oracle-red); font-weight: 800; letter-spacing: -.02em; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; overflow: hidden; }
.brand-text strong { font-size: 15px; line-height: 1.25; }
.brand-text small { color: var(--sidebar-muted); font-size: 12px; line-height: 1.35; }
.sidebar-close { display: none; width: 40px; height: 40px; border: 0; background: transparent; color: #fff; font-size: 28px; cursor: pointer; border-radius: 8px; }
.sidebar-close:hover { background: rgba(255,255,255,.08); }
.nav-search-wrap { padding: 14px 14px 10px; flex: 0 0 auto; }
.nav-search { width: 100%; height: 38px; color: #fff; background: #0e131a; border: 1px solid #303a48; border-radius: 9px; padding: 0 12px; outline: none; }
.nav-search::placeholder { color: #8792a2; }
.nav-search:focus { border-color: #6da6e6; box-shadow: 0 0 0 3px rgba(47,128,237,.2); }
.sidebar nav { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 20px; scrollbar-width: thin; scrollbar-color: #465061 transparent; }
.nav-root, .nav-root ul { list-style: none; padding: 0; margin: 0; }
.nav-group-title { color: #728096; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; padding: 18px 12px 7px; }
.nav-page { min-height: 42px; color: #dbe3ee; text-decoration: none; display: flex; align-items: center; gap: 10px; border-radius: 9px; padding: 6px 10px; margin: 2px 0; position: relative; transition: background .16s ease, color .16s ease; }
.nav-page:hover { color: #fff; background: var(--sidebar-hover); }
.nav-page.is-active { color: #fff; background: linear-gradient(90deg, rgba(199,70,52,.32), rgba(199,70,52,.10)); }
.nav-page.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #f06a55; }
.nav-code { width: 34px; height: 28px; border-radius: 7px; background: rgba(255,255,255,.06); display: grid; place-items: center; flex: 0 0 auto; font-size: 12px; font-weight: 800; color: #e6edf6; }
.nav-page.is-active .nav-code { background: var(--oracle-red); }
.nav-label { font-size: 13px; line-height: 1.4; min-width: 0; }
.nav-sections { margin: 4px 0 9px 50px !important; padding-left: 12px !important; border-left: 1px solid #354152; }
.nav-section { color: #9eabbb; text-decoration: none; display: block; font-size: 12.5px; line-height: 1.45; padding: 5px 8px; border-radius: 6px; }
.nav-section:hover, .nav-section.is-active { color: #fff; background: #222b37; }
.nav-section-item.level-3 .nav-section { padding-left: 16px; }
.nav-section-item.level-4 .nav-section { padding-left: 24px; }
.nav-page-item.is-filtered, .nav-section-item.is-filtered, .nav-group.is-filtered { display: none; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); color: #7f8b9d; font-size: 11px; padding: 12px 16px; display: flex; justify-content: space-between; flex: 0 0 auto; }
.nav-overlay { display: none; }

.page-shell { margin-left: var(--sidebar-width); min-height: 100vh; transition: margin-left .25s ease; }
.topbar { position: sticky; top: 0; z-index: 700; height: var(--topbar-height); background: rgba(255,255,255,.94); backdrop-filter: saturate(150%) blur(12px); border-bottom: 1px solid rgba(17,24,39,.09); display: flex; align-items: center; padding: 0 24px; gap: 16px; }
.menu-toggle { width: 42px; height: 42px; border: 1px solid #d8dde5; border-radius: 10px; background: #fff; display: none; place-content: center; gap: 4px; cursor: pointer; flex: 0 0 auto; }
.menu-toggle:hover { background: #f7f8fa; }
.menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #3f4752; }
.reading-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.reading-progress span { display: block; width: 0; height: 100%; background: var(--oracle-red); transition: width .08s linear; }

.main { padding: 34px 34px 80px; }
.article { width: min(100%, 1040px); margin: 0 auto; background: var(--surface); border: 1px solid #e3e6eb; border-radius: 18px; box-shadow: var(--shadow); padding: 52px 68px 56px; overflow: hidden; }
.index-main .article { width: min(100%, 1180px); }
.chapter-hero { border-bottom: 1px solid var(--line); padding-bottom: 32px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 10px; color: var(--oracle-red); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.chapter-hero h1, .cover-hero h1 { margin: 0; color: #18212d; font-size: clamp(36px, 4vw, 52px); line-height: 1.18; letter-spacing: -.035em; font-weight: 780; }
.chapter-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.chapter-meta span { display: inline-flex; align-items: center; gap: 7px; }
.chapter-meta span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #b9c0ca; }
.chapter-meta .source-link { color: var(--oracle-red-dark); font-weight: 700; text-decoration: none; }
.chapter-meta .source-link:hover { color: var(--oracle-red); text-decoration: underline; }
.article-body { font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "SimSun", serif; }
.article-body > p, .front-content > p { margin: 1em 0; font-size: 16.5px; line-height: 1.9; color: #303846; overflow-wrap: anywhere; }
.article-body > p.lead { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 19px; line-height: 1.75; color: #475467; margin: 0 0 34px; }
.article-body h2, .front-content h2 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; margin: 56px 0 18px; padding-top: 8px; color: #17202b; font-size: 28px; line-height: 1.35; letter-spacing: -.02em; scroll-margin-top: 90px; display: flex; align-items: baseline; gap: 8px; }
.article-body h2::after, .front-content h2::after { content: ""; height: 1px; flex: 1; margin-left: 14px; background: linear-gradient(90deg, #e3a198, transparent); }
.article-body h3 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; margin: 38px 0 14px; color: #263343; font-size: 22px; line-height: 1.42; scroll-margin-top: 90px; }
.article-body h4 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; margin: 28px 0 10px; color: #344054; font-size: 18px; line-height: 1.5; scroll-margin-top: 90px; }
.article-body section { margin: 0; }
.article-body .source-link,
.article-body .source-note { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: #667085; font-size: 13px; margin: 14px 0 22px; }
.article-body .source-link a,
.article-body .source-note a { color: var(--oracle-red-dark); font-weight: 700; text-decoration: none; }
.article-body .source-link a:hover,
.article-body .source-note a:hover { color: var(--oracle-red); text-decoration: underline; }
.heading-anchor { opacity: 0; color: #98a2b3; text-decoration: none; font-size: .7em; transition: opacity .15s; }
h2:hover .heading-anchor, h3:hover .heading-anchor, h4:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.article-body code, .front-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", monospace; font-size: .9em; background: #f1f3f5; color: #8e2b20; border: 1px solid #e5e7eb; border-radius: 5px; padding: .08em .32em; word-break: break-word; }
.doc-list { margin: 16px 0 22px; padding-left: 1.45em; font-family: "Noto Serif CJK SC", "Songti SC", serif; }
.doc-list li { margin: 8px 0; padding-left: .25em; line-height: 1.8; }
.doc-list li::marker { color: var(--oracle-red); font-weight: 700; }

.code-block { margin: 24px 0 30px; border-radius: 12px; overflow: hidden; background: var(--code-bg); border: 1px solid #22304a; box-shadow: 0 10px 24px rgba(15,23,42,.16); }
.code-toolbar { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 15px; background: #182238; border-bottom: 1px solid #293750; }
.code-lang { color: #aab7ca; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.copy-code { color: #d8e0ec; background: transparent; border: 1px solid #41506a; border-radius: 7px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.copy-code:hover { color: #fff; border-color: #7b8aa2; }
.code-block pre { margin: 0; padding: 20px 22px; overflow: auto; color: #e5e7eb; line-height: 1.65; tab-size: 2; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", monospace; font-size: 13.5px; }
.code-block pre code { display: block; min-width: max-content; background: none; border: 0; padding: 0; color: inherit; font-size: inherit; word-break: normal; }
.article-body pre.raw-code,
.article-body > pre,
.article-body section > pre {
  box-sizing: border-box;
  max-width: 100%;
  margin: 24px 0 30px;
  padding: 20px 22px;
  overflow: auto;
  color: #e5e7eb;
  background: var(--code-bg);
  border: 1px solid #22304a;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15,23,42,.16);
  line-height: 1.65;
  tab-size: 2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", monospace;
  font-size: 13.5px;
}
.article-body pre.raw-code code,
.article-body > pre code,
.article-body section > pre code {
  display: block;
  min-width: 100%;
  width: max-content;
  max-width: none;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  word-break: normal;
}
.source-examples,
.code-example,
.translation-section,
.learning-checkpoint,
.study-guide,
.study-grid,
.study-card {
  min-width: 0;
  max-width: 100%;
}
.study-guide p,
.study-card p,
.learning-checkpoint li {
  overflow-wrap: anywhere;
}

.callout { margin: 30px 0; border-radius: 12px; padding: 20px 22px; display: grid; grid-template-columns: 36px 1fr; gap: 14px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.callout-practice { background: #f1f8f4; border: 1px solid #b9dec7; }
.callout-note { background: #fff8e8; border: 1px solid #ecd39b; }
.callout-warning { background: #fff4ed; border: 1px solid #f5c2a4; }
.callout-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; }
.callout-practice .callout-icon { background: #33845a; }
.callout-note .callout-icon { background: #a87317; }
.callout-warning .callout-icon { background: #c2410c; }
.callout-title { font-weight: 800; color: #20352a; margin-bottom: 4px; }
.callout-note .callout-title { color: #644b16; }
.callout p { margin: 0; line-height: 1.75; color: #344054; }
.learning-checkpoint,
.practice-block {
  margin: 24px 0 30px;
  padding: 18px 20px;
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-left: 4px solid var(--oracle-red);
  border-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.learning-checkpoint p:first-child,
.practice-block h3 {
  margin-top: 0;
  font-weight: 800;
  color: #263343;
}
.learning-checkpoint ul,
.practice-block ul {
  margin: 10px 0 0;
  padding-left: 1.25em;
}
.hero-note, .single-cell-note { margin: 24px 0; border-radius: 12px; padding: 18px 20px; background: #f7f8fa; border: 1px solid #e2e6eb; }
.hero-note { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; border-left: 4px solid var(--oracle-red); }
.hero-note strong { font-size: 17px; }
.hero-note span { color: #525f70; }
.single-cell-note p { margin: 6px 0 0; }

.doc-figure { margin: 32px 0 36px; background: #f8fafc; border: 1px solid #e1e6ec; border-radius: 14px; padding: 15px; }
.figure-button { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; border-radius: 9px; }
.figure-button:focus-visible { outline: 3px solid rgba(47,128,237,.38); outline-offset: 3px; }
.doc-figure img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 8px; }
.doc-figure figcaption, .orphan-caption { margin: 13px 4px 0; color: #667085; font-size: 13px; line-height: 1.55; text-align: center; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }

.table-wrap { margin: 24px 0 32px; }
.table-hint { display: none; color: #7a8697; font-size: 12px; margin: 0 0 7px; text-align: right; }
.table-scroll { margin: 0; overflow-x: auto; border: 1px solid #dfe3e8; border-radius: 12px; background: #fff; scrollbar-width: thin; }
.table-scroll:focus { outline: 3px solid rgba(47,128,237,.18); outline-offset: 2px; }
table { width: 100%; min-width: 640px; border-collapse: collapse; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid #e5e7eb; border-right: 1px solid #eef0f2; line-height: 1.6; }
th:last-child, td:last-child { border-right: 0; }
thead th { background: #f0f2f5; color: #344054; font-weight: 750; position: sticky; top: 0; z-index: 1; }
tbody tr:nth-child(even) { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
.meta-list { margin: 24px 0 30px; border: 1px solid #e1e5ea; border-radius: 12px; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.meta-list > div { display: grid; grid-template-columns: minmax(150px, 30%) 1fr; border-bottom: 1px solid #e7eaee; }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list dt, .meta-list dd { margin: 0; padding: 11px 14px; }
.meta-list dt { background: #f6f7f9; color: #475467; font-weight: 700; }
.meta-list dd { color: #344054; }

.mobile-toc { display: none; margin: 0 0 28px; border: 1px solid #dfe3e8; border-radius: 10px; background: #fafbfc; }
.mobile-toc summary { cursor: pointer; padding: 12px 14px; font-weight: 700; }
.mobile-toc ol { margin: 0; padding: 0 18px 14px 38px; }
.mobile-toc li { margin: 5px 0; }
.mobile-toc a { text-decoration: none; }
.mobile-toc .toc-level-3 { margin-left: 16px; }

.page-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 60px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager-card { text-decoration: none; color: #344054; border: 1px solid #dfe3e8; border-radius: 12px; padding: 16px 18px; min-height: 82px; display: flex; flex-direction: column; justify-content: center; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.pager-card:hover { color: #222; transform: translateY(-2px); border-color: #e2a59b; box-shadow: 0 10px 20px rgba(16,24,40,.07); }
.pager-card span { color: #98a2b3; font-size: 12px; margin-bottom: 4px; }
.pager-card strong { font-size: 14px; line-height: 1.45; }
.pager-next { text-align: right; }
.document-footer { margin-top: 44px; color: #98a2b3; font-size: 12px; line-height: 1.6; text-align: center; }
.document-footer p { margin: 3px 0; }
.document-footer .community-credit { margin-top: 10px; color: #667085; font-weight: 650; }
.document-footer .community-credit a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #efb1a7;
  border-radius: 999px;
  background: #fff7f5;
  color: var(--oracle-red-dark);
  text-decoration: none;
}
.document-footer .community-credit a:hover { color: #fff; background: var(--oracle-red); border-color: var(--oracle-red); }
.back-to-top { position: fixed; right: 22px; bottom: 22px; z-index: 600; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #d7dce3; background: #fff; color: #344054; box-shadow: 0 8px 22px rgba(16,24,40,.13); cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .18s ease; }
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* Index */
.index-article { padding-top: 0; }
.cover-hero { margin: 0 -68px; padding: 58px 68px; min-height: 390px; background: radial-gradient(circle at 85% 20%, rgba(199,70,52,.16), transparent 38%), linear-gradient(135deg, #111827 0%, #202a37 75%); color: #fff; display: block; }
.cover-main { max-width: 850px; }
.cover-hero .eyebrow { color: #f08f80; }
.cover-hero h1 { color: #fff; font-size: 64px; }
.cover-subtitle { margin: 4px 0 18px; color: #f39b8e; font-size: 24px; font-weight: 700; }
.cover-description { max-width: 720px; margin: 0; color: #d7dee8; font-size: 18px; line-height: 1.8; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 14px; }
.primary-button { color: #fff; background: var(--oracle-red); }
.primary-button:hover { color: #fff; background: #d35543; }
.secondary-button { color: #fff; border: 1px solid rgba(255,255,255,.32); background: rgba(255,255,255,.05); }
.secondary-button:hover { color: #fff; background: rgba(255,255,255,.12); }
.chapter-overview { padding: 56px 0 12px; }
.section-heading { max-width: 760px; margin-bottom: 26px; }
.section-heading h2 { margin: 0 0 8px; font-size: 34px; line-height: 1.3; }
.section-heading > p:last-child { color: var(--muted); margin: 0; }
.chapter-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.chapter-card { color: #283444; text-decoration: none; display: grid; grid-template-columns: 48px 1fr; gap: 13px; padding: 18px; border: 1px solid #e1e5ea; border-radius: 13px; background: #fff; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.chapter-card:hover { color: #19212b; transform: translateY(-2px); border-color: #e2a59b; box-shadow: 0 10px 22px rgba(16,24,40,.08); }
.chapter-number { width: 42px; height: 42px; border-radius: 10px; background: #f4e6e2; color: var(--oracle-red-dark); display: grid; place-items: center; font-weight: 850; }
.chapter-card h3 { margin: 0 0 5px; font-size: 17px; line-height: 1.4; }
.chapter-card p { margin: 0; color: #667085; font-size: 13px; line-height: 1.6; }
.card-meta { display: inline-block; color: #98a2b3; font-size: 11px; margin-top: 8px; }
.front-content { padding-top: 24px; }
.front-content > h2:first-child { margin-top: 20px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(7,10,16,.92); display: none; align-items: center; justify-content: center; padding: 28px; }
.lightbox.is-open { display: flex; }
.lightbox-inner { max-width: min(96vw, 1500px); max-height: 94vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox img { max-width: 100%; max-height: calc(94vh - 64px); width: auto; height: auto; object-fit: contain; border-radius: 8px; background: #fff; }
.lightbox-caption { color: #e5e7eb; font-size: 14px; text-align: center; }
.lightbox-close { position: fixed; top: 18px; right: 20px; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3); font-size: 26px; cursor: pointer; }

body.sidebar-collapsed .sidebar { width: var(--sidebar-rail); }
body.sidebar-collapsed .page-shell { margin-left: var(--sidebar-rail); }
body.sidebar-collapsed .sidebar-header { padding: 0 18px; }
body.sidebar-collapsed .brand-text, body.sidebar-collapsed .nav-search-wrap, body.sidebar-collapsed .nav-group-title, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-sections, body.sidebar-collapsed .sidebar-footer { display: none; }
body.sidebar-collapsed .sidebar nav { padding: 10px 8px 18px; }
body.sidebar-collapsed .nav-page { justify-content: center; padding: 7px; margin: 5px 0; }
body.sidebar-collapsed .nav-code { width: 38px; height: 34px; }
body.sidebar-collapsed .nav-page.is-active::before { left: -8px; }

:focus-visible { outline: 3px solid rgba(47,128,237,.45); outline-offset: 2px; }

@media (max-width: 1099px) {
  .sidebar { width: min(88vw, 330px); transform: translateX(-103%); }
  .sidebar-close { display: block; }
  .page-shell, body.sidebar-collapsed .page-shell { margin-left: 0; }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-overlay { display: block; position: fixed; inset: 0; z-index: 900; background: rgba(10,14,20,.5); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .main { padding: 26px 24px 64px; }
  .article { padding: 44px 48px 50px; }
  .mobile-toc { display: block; }
  .menu-toggle { display: grid; }
  .cover-hero { margin: 0 -48px; padding: 52px 48px; }
  .cover-hero h1 { font-size: 56px; }
}

@media (max-width: 720px) {
  :root { --topbar-height: 56px; }
  body { background: #fff; }
  .topbar { padding: 0 12px; gap: 10px; }
  .menu-toggle { width: 40px; height: 40px; }
  .main { padding: 0 0 48px; }
  .article, .index-main .article { width: 100%; border: 0; border-radius: 0; box-shadow: none; padding: 30px 18px 40px; }
  .chapter-hero { padding-bottom: 24px; margin-bottom: 24px; }
  .chapter-hero h1 { font-size: 32px; line-height: 1.24; }
  .chapter-meta { gap: 6px 14px; }
  .article-body > p, .front-content > p { font-size: 16px; line-height: 1.82; }
  .article-body > p.lead { font-size: 17px; line-height: 1.72; margin-bottom: 26px; }
  .article-body h2, .front-content h2 { margin-top: 44px; font-size: 24px; }
  .article-body h2::after, .front-content h2::after { display: none; }
  .article-body h3 { margin-top: 32px; font-size: 20px; }
  .article-body h4 { font-size: 17px; }
  .heading-anchor { display: none; }
  .code-block { margin-left: -6px; margin-right: -6px; border-radius: 10px; }
  .code-block pre { padding: 17px 16px; font-size: 12.5px; }
  .callout { grid-template-columns: 30px 1fr; padding: 17px 16px; gap: 11px; }
  .callout-icon { width: 30px; height: 30px; }
  .doc-figure { margin-left: -6px; margin-right: -6px; padding: 8px; border-radius: 10px; }
  .table-wrap { margin-left: -6px; margin-right: -6px; }
  .table-hint { display: block; padding-right: 3px; }
  .table-scroll { border-radius: 9px; }
  table { min-width: 560px; font-size: 13px; }
  th, td { padding: 10px 11px; }
  .meta-list > div { grid-template-columns: 120px 1fr; }
  .page-pager { grid-template-columns: 1fr; margin-top: 46px; }
  .pager-next { text-align: left; }
  .cover-hero { margin: -30px -18px 0; padding: 40px 22px 42px; min-height: auto; }
  .cover-hero h1 { font-size: 38px; line-height: 1.18; }
  .cover-subtitle { font-size: 21px; }
  .cover-description { font-size: 16px; }
  .chapter-overview { padding-top: 42px; }
  .section-heading h2 { font-size: 29px; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter-card { padding: 15px; }
  .back-to-top { right: 14px; bottom: 14px; }
  .lightbox { padding: 14px; }
}

@media (max-width: 420px) {
  .article { padding-left: 16px; padding-right: 16px; }
  .cover-hero { margin-left: -16px; margin-right: -16px; }
  .meta-list > div { grid-template-columns: 1fr; }
  .meta-list dt { border-bottom: 1px solid #e7eaee; }
}

@media print {
  .sidebar, .topbar, .nav-overlay, .back-to-top, .page-pager, .mobile-toc, .copy-code, .lightbox { display: none !important; }
  .page-shell { margin: 0 !important; }
  .main { padding: 0; }
  .article { width: 100%; max-width: none; border: 0; box-shadow: none; padding: 0; }
  .doc-figure, .code-block, .table-wrap, .callout { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Pygments token colors */
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.code-block .hll { background-color: #49483e }
.code-block { background: #272822; color: #F8F8F2 }
.code-block .c { color: #959077 } /* Comment */
.code-block .err { color: #ED007E; background-color: #1E0010 } /* Error */
.code-block .esc { color: #F8F8F2 } /* Escape */
.code-block .g { color: #F8F8F2 } /* Generic */
.code-block .k { color: #66D9EF } /* Keyword */
.code-block .l { color: #AE81FF } /* Literal */
.code-block .n { color: #F8F8F2 } /* Name */
.code-block .o { color: #FF4689 } /* Operator */
.code-block .x { color: #F8F8F2 } /* Other */
.code-block .p { color: #F8F8F2 } /* Punctuation */
.code-block .ch { color: #959077 } /* Comment.Hashbang */
.code-block .cm { color: #959077 } /* Comment.Multiline */
.code-block .cp { color: #959077 } /* Comment.Preproc */
.code-block .cpf { color: #959077 } /* Comment.PreprocFile */
.code-block .c1 { color: #959077 } /* Comment.Single */
.code-block .cs { color: #959077 } /* Comment.Special */
.code-block .gd { color: #FF4689 } /* Generic.Deleted */
.code-block .ge { color: #F8F8F2; font-style: italic } /* Generic.Emph */
.code-block .ges { color: #F8F8F2; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.code-block .gr { color: #F8F8F2 } /* Generic.Error */
.code-block .gh { color: #F8F8F2 } /* Generic.Heading */
.code-block .gi { color: #A6E22E } /* Generic.Inserted */
.code-block .go { color: #66D9EF } /* Generic.Output */
.code-block .gp { color: #FF4689; font-weight: bold } /* Generic.Prompt */
.code-block .gs { color: #F8F8F2; font-weight: bold } /* Generic.Strong */
.code-block .gu { color: #959077 } /* Generic.Subheading */
.code-block .gt { color: #F8F8F2 } /* Generic.Traceback */
.code-block .kc { color: #66D9EF } /* Keyword.Constant */
.code-block .kd { color: #66D9EF } /* Keyword.Declaration */
.code-block .kn { color: #FF4689 } /* Keyword.Namespace */
.code-block .kp { color: #66D9EF } /* Keyword.Pseudo */
.code-block .kr { color: #66D9EF } /* Keyword.Reserved */
.code-block .kt { color: #66D9EF } /* Keyword.Type */
.code-block .ld { color: #E6DB74 } /* Literal.Date */
.code-block .m { color: #AE81FF } /* Literal.Number */
.code-block .s { color: #E6DB74 } /* Literal.String */
.code-block .na { color: #A6E22E } /* Name.Attribute */
.code-block .nb { color: #F8F8F2 } /* Name.Builtin */
.code-block .nc { color: #A6E22E } /* Name.Class */
.code-block .no { color: #66D9EF } /* Name.Constant */
.code-block .nd { color: #A6E22E } /* Name.Decorator */
.code-block .ni { color: #F8F8F2 } /* Name.Entity */
.code-block .ne { color: #A6E22E } /* Name.Exception */
.code-block .nf { color: #A6E22E } /* Name.Function */
.code-block .nl { color: #F8F8F2 } /* Name.Label */
.code-block .nn { color: #F8F8F2 } /* Name.Namespace */
.code-block .nx { color: #A6E22E } /* Name.Other */
.code-block .py { color: #F8F8F2 } /* Name.Property */
.code-block .nt { color: #FF4689 } /* Name.Tag */
.code-block .nv { color: #F8F8F2 } /* Name.Variable */
.code-block .ow { color: #FF4689 } /* Operator.Word */
.code-block .pm { color: #F8F8F2 } /* Punctuation.Marker */
.code-block .w { color: #F8F8F2 } /* Text.Whitespace */
.code-block .mb { color: #AE81FF } /* Literal.Number.Bin */
.code-block .mf { color: #AE81FF } /* Literal.Number.Float */
.code-block .mh { color: #AE81FF } /* Literal.Number.Hex */
.code-block .mi { color: #AE81FF } /* Literal.Number.Integer */
.code-block .mo { color: #AE81FF } /* Literal.Number.Oct */
.code-block .sa { color: #E6DB74 } /* Literal.String.Affix */
.code-block .sb { color: #E6DB74 } /* Literal.String.Backtick */
.code-block .sc { color: #E6DB74 } /* Literal.String.Char */
.code-block .dl { color: #E6DB74 } /* Literal.String.Delimiter */
.code-block .sd { color: #E6DB74 } /* Literal.String.Doc */
.code-block .s2 { color: #E6DB74 } /* Literal.String.Double */
.code-block .se { color: #AE81FF } /* Literal.String.Escape */
.code-block .sh { color: #E6DB74 } /* Literal.String.Heredoc */
.code-block .si { color: #E6DB74 } /* Literal.String.Interpol */
.code-block .sx { color: #E6DB74 } /* Literal.String.Other */
.code-block .sr { color: #E6DB74 } /* Literal.String.Regex */
.code-block .s1 { color: #E6DB74 } /* Literal.String.Single */
.code-block .ss { color: #E6DB74 } /* Literal.String.Symbol */
.code-block .bp { color: #F8F8F2 } /* Name.Builtin.Pseudo */
.code-block .fm { color: #A6E22E } /* Name.Function.Magic */
.code-block .vc { color: #F8F8F2 } /* Name.Variable.Class */
.code-block .vg { color: #F8F8F2 } /* Name.Variable.Global */
.code-block .vi { color: #F8F8F2 } /* Name.Variable.Instance */
.code-block .vm { color: #F8F8F2 } /* Name.Variable.Magic */
.code-block .il { color: #AE81FF } /* Literal.Number.Integer.Long */

/* APEX Iris Theme adaptation */
:root {
  --oracle-red: #00688c;
  --oracle-red-dark: #005a78;
  --iris-primary: #00688c;
  --iris-primary-shade: #e4f1f7;
  --iris-danger: #b3311f;
  --iris-success: #436b1d;
  --iris-warning: #8f520a;
  --iris-info: #227e9e;
  --ink: #161513;
  --muted: #666666;
  --line: rgba(0,0,0,.1);
  --surface: #ffffff;
  --surface-alt: #f1efed;
  --canvas: #fbf9f8;
  --sidebar: #302d2a;
  --sidebar-muted: rgba(255,255,255,.72);
  --sidebar-hover: rgba(255,255,255,.08);
  --focus: #00688c;
  --code-bg: #302d2a;
  --radius-sm: 2px;
  --radius-md: 4px;
  --shadow: 0 2px 4px -2px rgba(0,0,0,.12);
}

body {
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, "system-ui", "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}

a { color: var(--iris-primary); }
a:hover { color: var(--oracle-red-dark); }

.skip-link {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.sidebar {
  background: var(--sidebar);
  box-shadow: -1px 0 0 rgba(0,0,0,.1) inset;
}
.sidebar-header {
  border-bottom-color: rgba(255,255,255,.08);
}
.brand-mark {
  border-radius: var(--radius-md);
  background: var(--iris-primary);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.brand-text small { color: var(--sidebar-muted); }
.sidebar-close { border-radius: var(--radius-md); }
.sidebar-close:hover { background: var(--sidebar-hover); }

.nav-search {
  height: 32px;
  color: #fff;
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
  border-radius: var(--radius-md);
}
.nav-search::placeholder { color: rgba(255,255,255,.62); }
.nav-search:focus {
  border-color: var(--iris-primary);
  box-shadow: 0 0 0 1px var(--iris-primary);
}
.sidebar nav {
  scrollbar-color: rgba(255,255,255,.28) transparent;
}
.nav-group-title {
  color: rgba(255,255,255,.5);
  font-size: 11px;
  letter-spacing: .08em;
}
.nav-page {
  min-height: 40px;
  color: rgba(255,255,255,.82);
  border-radius: var(--radius-md);
}
.nav-page:hover {
  color: #fff;
  background: var(--sidebar-hover);
}
.nav-page.is-active {
  color: #fff;
  background: var(--iris-primary);
}
.nav-page.is-active::before { display: none; }
.nav-code {
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.82);
}
.nav-page.is-active .nav-code {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.nav-sections {
  border-left-color: rgba(255,255,255,.14);
}
.nav-section {
  color: rgba(255,255,255,.68);
  border-radius: var(--radius-sm);
}
.nav-section:hover,
.nav-section.is-active {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.sidebar-footer {
  color: rgba(255,255,255,.54);
  border-top-color: rgba(255,255,255,.08);
}

.topbar {
  background: var(--sidebar);
  border-bottom-color: rgba(0,0,0,.2);
  color: #fff;
  backdrop-filter: none;
}
.menu-toggle {
  width: 40px;
  height: 40px;
  border-color: rgba(255,255,255,.18);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.06);
}
.menu-toggle:hover { background: rgba(255,255,255,.1); }
.menu-toggle span { background: #fff; }
.reading-progress span { background: var(--iris-primary); }

.main { background: var(--canvas); }
.article {
  background: var(--surface);
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}
.chapter-hero {
  margin: -52px -68px 34px;
  padding: 32px 68px 30px;
  border-bottom-color: var(--line);
  background: var(--surface-alt);
  box-shadow: 0 1px 0 0 rgba(0,0,0,.1);
}
.eyebrow {
  color: var(--iris-primary);
  letter-spacing: .08em;
}
.chapter-hero h1,
.cover-hero h1 {
  color: var(--ink);
  letter-spacing: -.02em;
  font-weight: 700;
}
.chapter-meta { color: var(--muted); }
.chapter-meta span::before { background: rgba(22,21,19,.28); }
.chapter-meta .source-link {
  color: var(--iris-primary);
  font-weight: 700;
}
.chapter-meta .source-link:hover { color: var(--oracle-red-dark); }

.article-body { font-family: -apple-system, "system-ui", "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif; }
.article-body > p,
.front-content > p {
  color: #2d2a26;
}
.article-body > p.lead {
  color: #3f3a35;
}
.article-body h2,
.front-content h2,
.article-body h3,
.article-body h4 {
  color: var(--ink);
}
.article-body h2::after,
.front-content h2::after {
  background: linear-gradient(90deg, rgba(0,104,140,.38), transparent);
}
.heading-anchor { color: var(--iris-primary); }
.article-body code,
.front-content code {
  background: var(--iris-primary-shade);
  color: #004d68;
  border-color: rgba(0,104,140,.18);
  border-radius: var(--radius-sm);
}
.doc-list { font-family: inherit; }
.doc-list li::marker { color: var(--iris-primary); }

.code-block {
  border-color: rgba(0,0,0,.16);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}
.code-toolbar {
  background: #25221f;
  border-bottom-color: rgba(255,255,255,.08);
}
.copy-code {
  min-height: 28px;
  border-color: rgba(255,255,255,.22);
  border-radius: var(--radius-md);
}

.callout,
.hero-note,
.single-cell-note,
.doc-figure,
.table-scroll,
.meta-list,
.mobile-toc,
.pager-card,
.chapter-card {
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
}
.callout-practice {
  background: #f5f8f2;
  border-color: rgba(67,107,29,.28);
}
.callout-note {
  background: #fff8ef;
  border-color: rgba(143,82,10,.28);
}
.callout-icon {
  border-radius: var(--radius-md);
}
.callout-title { color: var(--ink); }
.callout p { color: #3f3a35; }
.hero-note,
.single-cell-note,
.doc-figure,
.mobile-toc {
  background: #fcfbfa;
}
.hero-note {
  border-left: 1px solid var(--line);
  box-shadow: inset 4px 0 0 var(--iris-primary);
}
.hero-note span { color: var(--muted); }
.figure-button { border-radius: var(--radius-md); }
.doc-figure img { border-radius: var(--radius-sm); }
.doc-figure figcaption,
.orphan-caption,
.table-hint {
  color: var(--muted);
}
thead th {
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 600;
}
th,
td {
  border-color: var(--iris-report-border, #e6e6e6);
}
tbody tr:nth-child(even) { background: #fbfbfb; }
.meta-list dt {
  background: var(--surface-alt);
  color: var(--ink);
}
.meta-list dd { color: #312e2a; }

.pager-card {
  background: var(--surface);
  color: var(--ink);
}
.pager-card:hover {
  color: var(--ink);
  border-color: rgba(0,104,140,.38);
  box-shadow: var(--shadow);
}
.pager-card span,
.card-meta,
.document-footer {
  color: var(--muted);
}
.document-footer .community-credit { color: #3f3a35; }
.document-footer .community-credit a {
  border-color: rgba(0,104,140,.22);
  background: var(--iris-primary-shade);
  color: var(--iris-primary);
}
.document-footer .community-credit a:hover {
  color: #fff;
  background: var(--iris-primary);
  border-color: var(--iris-primary);
}
.back-to-top {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.index-article { background: var(--surface); }
.cover-hero {
  background: var(--surface-alt);
  color: var(--ink);
  box-shadow: 0 1px 0 0 rgba(0,0,0,.1);
}
.cover-hero .eyebrow { color: var(--iris-primary); }
.cover-hero h1 { color: var(--ink); }
.cover-subtitle { color: var(--iris-primary); }
.cover-description { color: #3f3a35; }
.community-byline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-top: 18px;
  padding: 8px 10px;
  border: 1px solid rgba(0,104,140,.22);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.72);
  color: var(--ink);
}
.community-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0,104,140,.18);
}
.community-byline strong,
.community-byline span {
  display: block;
}
.community-byline strong {
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}
.community-byline span {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}
.primary-button,
.secondary-button {
  min-height: 32px;
  border-radius: var(--radius-md);
  padding: 7px 12px;
  font-size: 12px;
  line-height: 16px;
}
.primary-button {
  color: #fff;
  background: var(--iris-primary);
  border: 1px solid var(--iris-primary);
}
.primary-button:hover {
  color: #fff;
  background: var(--oracle-red-dark);
}
.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(22,21,19,.04);
}
.secondary-button:hover {
  color: var(--ink);
  background: rgba(22,21,19,.08);
}
.section-heading h2 { color: var(--ink); }
.section-heading > p:last-child { color: var(--muted); }
.chapter-card {
  background: var(--surface);
  color: var(--ink);
}
.chapter-card:hover {
  color: var(--ink);
  border-color: rgba(0,104,140,.38);
  box-shadow: var(--shadow);
}
.chapter-number {
  border-radius: var(--radius-md);
  background: var(--iris-primary-shade);
  color: var(--iris-primary);
}
.chapter-card h3 { color: var(--ink); }
.chapter-card p { color: var(--muted); }

.study-guide {
  margin: 44px 0 28px;
  padding: 24px;
  border: 1px solid rgba(0,104,140,.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(0,104,140,.06), rgba(255,255,255,.92));
}
.study-guide-header {
  max-width: 780px;
  margin-bottom: 20px;
}
.study-guide-header h2 {
  margin: 6px 0 8px;
}
.study-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.study-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.82);
}
.study-card-wide {
  grid-column: 1 / -1;
}
.study-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}
.study-card p,
.study-card li {
  color: var(--text);
}
.study-source {
  margin-top: 10px;
}
.study-task-list {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}
.study-task-list li span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

:focus-visible {
  outline: 2px solid var(--iris-primary);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  body { background: var(--canvas); }
  .article,
  .index-main .article {
    background: var(--surface);
    border-radius: 0;
  }
  .chapter-hero {
    margin: -30px -18px 24px;
    padding: 28px 18px 24px;
  }
  .cover-hero {
    background: var(--surface-alt);
  }
  .code-block,
  .doc-figure,
  .table-scroll {
    border-radius: var(--radius-md);
  }
  .study-guide {
    margin: 34px 0 22px;
    padding: 18px;
  }
  .study-grid {
    grid-template-columns: 1fr;
  }
  .study-card-wide {
    grid-column: auto;
  }
}

@media (max-width: 420px) {
  .chapter-hero {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}
