:root {
  --bg: #f6f7f5;
  --panel: #ffffff;
  --panel-soft: #f0f3f1;
  --text: #202825;
  --muted: #66716c;
  --line: #dce2de;
  --accent: #176b70;
  --accent-soft: #e6f0ee;
  --danger: #a94c54;
  --success: #2f7857;
  --radius: 7px;
  --shadow: 0 7px 22px rgba(31, 45, 40, .045);
  --content: 1120px;
  --site-header-height: 58px;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--site-header-height) + 26px); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); line-height: 1.65; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

[data-site-header] { display: block; min-height: var(--site-header-height); }
[data-site-header][hidden] { display: none; min-height: 0; }
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(22px, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.site-logo { color: var(--text); font-size: 17px; font-weight: 900; letter-spacing: -.025em; text-decoration: none; }
.site-navigation { min-height: 58px; display: flex; align-items: center; gap: 28px; }
.site-navigation a { position: relative; color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; }
.site-navigation a:hover, .site-navigation a.is-active { color: var(--accent); }
.site-navigation a.is-active::after { content: ""; position: absolute; right: 0; bottom: -19px; left: 0; height: 2px; background: var(--accent); }
.site-navigation form { margin: 0; }
.site-navigation form button, .site-menu-button { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: #fff; }
.site-navigation form button:hover, .site-menu-button:hover { color: var(--accent); border-color: var(--accent); }
.site-menu-button { display: none; }

.page-container { width: min(var(--content), calc(100% - 40px)); margin: 0 auto; }
.page-main { padding: 34px 0 72px; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb i { color: #9ca6a1; font-style: normal; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.page-title { margin: 7px 0 9px; font-size: clamp(30px, 5vw, 48px); line-height: 1.15; letter-spacing: -.045em; }
.page-description { max-width: 720px; margin: 0; color: var(--muted); font-size: 16px; }
.page-heading { margin-bottom: 32px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin: 0 0 15px; }
.section-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.section-heading p, .section-heading span { margin: 0; color: var(--muted); font-size: 12px; }
.content-section + .content-section { margin-top: 38px; }

.search-panel { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.search-panel h1 { margin: 0 0 7px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.04em; }
.search-panel > p { margin: 0 0 20px; color: var(--muted); }
.global-search { height: 50px; display: flex; overflow: hidden; border: 1px solid #cbd5d0; border-radius: var(--radius); background: #fff; }
.global-search input { flex: 1; min-width: 0; padding: 0 15px; border: 0; outline: 0; color: var(--text); background: transparent; }
.global-search input:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.global-search button, .button-primary { padding: 0 20px; border: 0; color: #fff; background: var(--accent); font-weight: 800; }
.global-search button:hover, .button-primary:hover { background: #10595d; }

.category-grid, .subcategory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.category-card, .subcategory-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 22px;
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease;
}
.category-card:hover, .subcategory-card:hover { border-color: #9fbcb6; transform: translateY(-2px); }
.category-card h2, .subcategory-card h2 { margin: 2px 0 7px; font-size: 22px; }
.category-card p, .subcategory-card p { margin: 0; color: var(--muted); font-size: 13px; }
.category-card small, .subcategory-card small { display: block; margin-top: 17px; color: var(--accent); font-size: 12px; font-weight: 800; }
.category-illustration { width: 100%; aspect-ratio: 4 / 3; align-self: center; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-soft); object-fit: cover; }
.subcategory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.subcategory-card { grid-template-columns: 1fr; min-height: 0; padding: 17px; gap: 13px; }
.subcategory-card .category-illustration { aspect-ratio: 16 / 9; }
.subcategory-card h2 { font-size: 17px; }

.article-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.article-list-item { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 17px; border-bottom: 1px solid var(--line); text-decoration: none; }
.article-list-item:last-child { border-bottom: 0; }
.article-list-item:hover { background: #fafcfb; }
.article-list-item strong, .article-list-item small { display: block; }
.article-list-item small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.article-list-item i { color: var(--accent); font-size: 12px; font-style: normal; white-space: nowrap; }
.status-label { display: inline-flex; padding: 3px 7px; border-radius: 999px; color: var(--muted); background: var(--panel-soft); font-size: 10px; }

.category-intro { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: center; margin-bottom: 36px; }
.category-intro .category-illustration { aspect-ratio: 16 / 9; }
.category-filter-bar { margin-bottom: 24px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.category-filter-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.category-filter-heading h2 { margin: 0; font-size: 16px; }
.category-filter-heading span { color: var(--muted); font-size: 12px; }
.category-filter-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.category-filter-button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel); font: inherit; font-size: 13px; cursor: pointer; }
.category-filter-button:hover, .category-filter-button:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.category-filter-button.is-active { color: #fff; border-color: var(--accent); background: var(--accent); }
.category-filter-button span { display: inline-grid; min-width: 18px; place-items: center; padding: 1px 5px; border-radius: 999px; color: inherit; background: color-mix(in srgb, currentColor 12%, transparent); font-size: 11px; }
.category-filter-button.is-active span { background: rgba(255,255,255,.2); }
.article-list-item[hidden] { display: none; }
.category-filter-empty { margin-top: 14px; }
.placeholder-panel { padding: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.placeholder-panel h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.04em; }
.placeholder-panel p { color: var(--muted); }
.placeholder-panel ul { margin: 20px 0; color: var(--muted); }
.text-link { color: var(--accent); font-weight: 800; text-decoration: none; }

.article-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); gap: 32px; align-items: center; margin-bottom: 28px; }
.article-utility-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -6px 0 22px; }
.article-utility-bar__left { display: flex; align-items: center; gap: 8px; }
.article-utility-bar form { margin: 0; }
.article-utility-button { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--panel); box-shadow: 0 2px 7px rgba(37, 61, 53, .05); font: 750 14px/1 Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; text-decoration: none; cursor: pointer; }
.article-utility-button:hover, .article-utility-button:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.article-utility-button--home { color: #fff; border-color: var(--accent); background: var(--accent); }
.article-utility-button--home:hover, .article-utility-button--home:focus-visible { color: #fff; background: #10595d; }
.article-utility-button--logout { font: 750 14px/1 Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; }
.article-heading h1 { margin: 7px 0 10px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; letter-spacing: -.048em; }
@media (max-width: 620px) { .article-utility-bar { align-items: stretch; flex-wrap: wrap; margin-bottom: 18px; } .article-utility-bar__left { flex: 1; } .article-utility-button { justify-content: center; } .article-utility-button--home { flex: 1; } }
.article-heading .article-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: 12px; }
.article-cover { width: min(100%, 320px); justify-self: end; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-soft); box-shadow: var(--shadow); }
.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-cover figcaption { padding: 8px 11px; color: var(--muted); font-size: 11px; }
.article-section-nav { position: sticky; top: var(--site-header-height); z-index: 50; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.article-page .article-section-nav { top: 0; }
.article-section-nav .page-tabs { display: flex; gap: 7px; overflow: auto; }
.article-section-nav button, .article-section-nav .page-tab { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: var(--panel); font-size: 12px; text-decoration: none; }
.article-section-nav button:hover, .article-section-nav button.is-active, .article-section-nav .page-tab:hover, .article-section-nav .page-tab.is-active { color: #fff; border-color: var(--accent); background: var(--accent); }
.article-section-nav button span { margin-right: 5px; opacity: .7; }
.page-status-row { display: flex; align-items: center; gap: 16px; padding-top: 8px; color: var(--muted); font-size: 11px; }
.page-status-copy { display: flex; gap: 8px; min-width: 0; }
.page-progress { flex: 1; height: 3px; overflow: hidden; background: var(--line); }
.page-progress span { display: block; width: 12.5%; height: 100%; background: var(--accent); }
.article-body { padding-top: 28px; }
.article-body .lesson-page > .wrap, .article-body > .wrap { width: 100%; max-width: none; }
.article-body .lesson-page { padding: 0; }
.article-body h2 { letter-spacing: -.03em; }
.article-body pre { overflow: auto; border-radius: var(--radius); }
.related-links { margin-top: 46px; padding-top: 28px; border-top: 1px solid var(--line); }

.knowledge-tree { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.knowledge-tree ul { margin: 8px 0; padding-left: 24px; }
.knowledge-tree li { margin: 7px 0; color: var(--muted); }
.knowledge-tree a { color: var(--text); text-decoration: none; }
.knowledge-tree a:hover { color: var(--accent); }
.knowledge-tree strong { color: var(--text); }

.glossary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.glossary-entry { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.glossary-entry h2 { margin: 0 0 5px; color: var(--accent); font-size: 17px; }
.glossary-entry p { margin: 0; color: var(--muted); font-size: 13px; }

.ai-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; }
.ai-info, .chat-panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.ai-info h2, .chat-panel h2 { margin: 0 0 6px; font-size: 20px; }
.ai-info p, .status { color: var(--muted); font-size: 13px; }
.status.ready { color: var(--success); }
.status.error { color: var(--danger); }
.messages { min-height: 180px; max-height: 430px; margin: 14px 0; overflow: auto; }
.message { max-width: 88%; margin: 8px 0; padding: 10px 12px; border-radius: var(--radius); color: var(--text); background: var(--panel-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { margin-left: auto; color: var(--accent); background: var(--accent-soft); }
.message.pending { color: var(--muted); }
.message-link { color: #176b70; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.message-link:hover, .message-link:focus-visible { color: #104f54; }
.empty-state { padding: 24px; color: var(--muted); text-align: center; }
.chat-form textarea { width: 100%; min-height: 90px; resize: vertical; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: #fff; outline: 0; }
.chat-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; }
.form-footer button { padding: 8px 13px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: #fff; }
.form-footer .button-primary { color: #fff; border-color: var(--accent); }

.login-page { display: flex; min-height: calc(100vh - 59px); align-items: center; justify-content: center; padding: 40px 20px; }
.login-card { width: min(420px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 7px; font-size: 28px; letter-spacing: -.04em; }
.login-card > p { color: var(--muted); }
.login-card form { margin-top: 22px; }
.login-card label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; }
.login-card input { width: 100%; height: 46px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); outline: 0; }
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card form button { width: 100%; height: 44px; margin-top: 12px; border: 0; border-radius: var(--radius); color: #fff; background: var(--accent); font-weight: 800; }
.login-card .error { padding: 9px 11px; color: var(--danger); background: #f8ebec; }
.login-card .note { margin-top: 15px; font-size: 11px; text-align: center; }

.site-footer { margin-top: 54px; padding: 24px 20px; border-top: 1px solid var(--line); color: var(--muted); background: #fff; font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .site-header { padding-inline: 20px; }
  .site-menu-button { display: block; }
  .site-navigation { position: absolute; top: 58px; right: 14px; left: 14px; min-height: 0; display: none; align-items: stretch; flex-direction: column; gap: 0; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
  .site-navigation.is-open { display: flex; }
  .site-navigation a, .site-navigation form button { width: 100%; padding: 9px; text-align: left; }
  .site-navigation a.is-active::after { display: none; }
  .category-grid, .subcategory-grid { grid-template-columns: 1fr 1fr; }
  .category-intro, .article-heading, .ai-layout { grid-template-columns: 1fr; }
  .article-heading .article-cover { max-width: 320px; justify-self: start; }
}

@media (max-width: 620px) {
  .page-container { width: min(var(--content), calc(100% - 24px)); }
  .page-main { padding-top: 24px; }
  .search-panel, .placeholder-panel { padding: 20px; }
  .category-grid, .subcategory-grid, .glossary-grid { grid-template-columns: 1fr; }
  .category-card { grid-template-columns: 1fr 118px; min-height: 158px; padding: 17px; gap: 14px; }
  .category-card h2 { font-size: 19px; }
  .article-heading { gap: 22px; }
  .article-section-nav { top: var(--site-header-height); }
  .page-status-copy span { display: none; }
  .form-footer { align-items: stretch; flex-direction: column; }
}

.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Legacy article shell isolation */
.site-header .site-navigation,.breadcrumb{position:static;top:auto;z-index:auto;padding:0;border:0;background:transparent;box-shadow:none;backdrop-filter:none}
.article-section-nav{position:sticky;top:var(--site-header-height)}
.preview-tags .is-selected,.preview-cards .is-selected{border-color:var(--accent)}

.code-block { margin: 20px 0; overflow: hidden; border: 1px solid #26384d; border-radius: var(--radius); background: #101a27; color: #d8e2ef; box-shadow: var(--shadow); }
.code-block-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 13px; border-bottom: 1px solid #26384d; color: #91c9ff; background: #172536; font: 700 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.code-block-head small { color: #778da5; font-weight: 600; }
.code-block pre { margin: 0; padding: 12px 0; overflow: auto; border-radius: 0; background: transparent; }
.code-block code { display: block; min-width: max-content; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.code-line { display: grid; grid-template-columns: 48px minmax(0, 1fr); padding-right: 18px; white-space: pre; }
.code-line > i { padding-right: 12px; color: #60758d; font-style: normal; text-align: right; user-select: none; border-right: 1px solid #26384d; margin-right: 14px; }
.token-comment { color: #6f899f; }
.token-string { color: #b9dc8b; }
.token-decorator { color: #d7a9ff; }
.token-keyword { color: #8cc8ff; }
.token-number { color: #f2c47d; }

/* Shared article reading system: typography, measured media and contextual callouts. */
.article-body { width: min(880px, 100%); margin: 0 auto; font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif; font-size: clamp(15px, 1vw, 17px); line-height: 1.85; }
.article-body > h2 { position: relative; margin: 52px 0 22px; padding: 15px 18px 15px 22px; border: 1px solid #c9ddd5; border-radius: 14px; color: #1f413b; background: linear-gradient(135deg, #edf6f2, #f9f4eb); box-shadow: 0 12px 28px rgba(42, 80, 69, .07); font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: clamp(21px, 2.25vw, 27px); line-height: 1.34; }
.article-body > h2 { scroll-margin-top: 82px; }
.article-body > h2::before { content: ""; position: absolute; top: 16px; bottom: 16px; left: 0; width: 5px; border-radius: 0 4px 4px 0; background: var(--accent); }
.article-body h3 { margin: 30px 0 11px; color: #285d56; font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 18px; }
.article-body h4 { margin: 26px 0 10px; color: #496b9a; font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: 16px; }
.article-body p { margin: 0 0 18px; color: #31413d; }
.article-body a { color: #176b70; font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; font-weight: 800; text-underline-offset: 3px; }
.article-body :is(ul, ol) { margin: 0 0 22px; padding: 16px 20px 16px 42px; border: 1px solid #d9e4df; border-radius: 13px; background: #fbfdfc; }
.article-body li + li { margin-top: 8px; }
.article-body :is(img, .image-list img) { width: auto !important; max-width: min(100%, 320px) !important; max-height: 360px; margin: 12px auto; border: 1px solid #cedbd5; border-radius: 10px; box-shadow: 0 9px 20px rgba(37, 61, 53, .08); object-fit: contain; background: #fff; }
.article-body p:has(> img):not(:has(> :not(img))) { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); justify-content: center; align-items: center; gap: 14px; margin: 16px 0 22px; }
.article-body p:has(> img):not(:has(> :not(img))) > img { margin: 0 auto; }
.article-body p:has(> img:only-child):not(:has(> :not(img))) { grid-template-columns: minmax(0, 320px); }
.article-body p:has(> img:only-child):has(+ p > img:only-child),
.article-body p:has(> img:only-child) + p:has(> img:only-child) { display: inline-grid; width: calc(50% - 12px); margin: 8px 8px 16px 0; vertical-align: top; }
.article-media-grid { width: min(100%, 680px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px auto 24px; align-items: center; }
.article-media-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article-media-grid figure { min-width: 0; margin: 0; text-align: center; }
.article-media-grid img { margin: 0 auto !important; }
.article-media-grid figcaption { margin-top: 7px; color: var(--muted); font: 500 12px/1.5 Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; }
.article-body .image-list { list-style: none; margin: 20px 0; padding: 0; border: 0; background: transparent; }
.article-body .image-item { margin: 0; }
.article-body .article-callout { margin: 26px 0; padding: 16px 19px; border: 1px solid #ead5ad; border-left: 5px solid #ad7724; border-radius: 0 13px 13px 0; color: #6c5221; background: #fff9ec; font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; font-size: .92em; line-height: 1.75; box-shadow: 0 8px 20px rgba(119, 89, 29, .06); }
.article-body .article-callout strong { color: #935f14; }
.article-body :not(pre) > code { padding: .14em .38em; border: 1px solid #d6e2dd; border-radius: 5px; color: #245e58; background: #edf5f2; font-family: "Cascadia Code", Consolas, monospace; font-size: .84em; }
.article-body blockquote { margin: 24px 0; padding: 14px 18px; border-left: 4px solid #496b9a; color: #3f5273; background: #edf1f8; }
@media (max-width: 620px) { .article-body { font-size: 15px; line-height: 1.8; } .article-body > h2 { margin-top: 38px; padding: 13px 14px 13px 18px; font-size: 20px; } .article-body :is(img, .image-list img) { margin: 16px auto; border-radius: 10px; } }
@media (max-width: 620px) { .article-body p:has(> img):not(:has(> :not(img))) { grid-template-columns: minmax(0, 320px); } .article-body p:has(> img:only-child):has(+ p > img:only-child), .article-body p:has(> img:only-child) + p:has(> img:only-child) { display: grid; width: 100%; margin: 10px 0 16px; } .article-media-grid, .article-media-grid--3 { width: 100%; grid-template-columns: 1fr; gap: 12px; } }
/* Preview: bolder technical prose and terminology treatment. */
.article-body { color: #202c29; font-weight: 500; letter-spacing: .012em; }
.article-body p, .article-body li { color: #25332f; }
.article-body strong { display: inline; padding: .08em .28em; border-radius: 4px; color: #9a452f; background: #faece5; font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; font-weight: 850; letter-spacing: .01em; }
.article-body h2 { font-weight: 900; }
.article-body h3, .article-body h4 { font-weight: 850; }
.article-body .article-callout { color: #594018; font-weight: 600; }
.article-body .article-callout strong { color: #843b29; background: #f6e3d7; }
.article-body > h2:last-of-type + ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0; border: 0; background: transparent; }
.article-body > h2:last-of-type + ul li { margin: 0; padding: 14px 15px; border: 1px solid #d9d2c9; border-radius: 12px; background: linear-gradient(145deg, #fff, #fbf6ef); box-shadow: 0 8px 20px rgba(87, 61, 36, .06); }
.article-body > h2:last-of-type + ul strong { display: table; margin-bottom: 6px; color: #176b70; background: #e4f1ee; }
@media (max-width: 620px) { .article-body > h2:last-of-type + ul { grid-template-columns: 1fr; } }
/* Preview adjustment: keep hierarchy, reduce headline heaviness. */
.article-body > h2 { font-weight: 760; }
.article-body h3, .article-body h4 { font-weight: 720; }
.article-body strong { font-weight: 720; }
/* Level Wiki approved note standard: reusable terminology index. */
.article-term-index { margin-top: 46px; padding-top: 6px; }
.article-term-index > h2 { margin-bottom: 18px; }
.article-term-index > ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0; padding: 0; border: 0; background: transparent; list-style: none; }
.article-term-index > ul li { margin: 0; padding: 14px 15px; border: 1px solid #d9d2c9; border-radius: 12px; background: linear-gradient(145deg, #fff, #fbf6ef); box-shadow: 0 8px 20px rgba(87, 61, 36, .06); }
.article-term-index > ul strong { display: table; margin-bottom: 6px; color: #176b70; background: #e4f1ee; }
.article-term-index > ul span { display: block; color: #4a5853; font-size: .88em; line-height: 1.65; }
@media (max-width: 620px) { .article-term-index > ul { grid-template-columns: 1fr; } }
/* Shared full-screen image viewer. */
img:not([data-lightbox="off"]) { cursor: zoom-in; }
.has-image-lightbox { overflow: hidden; }
.image-lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 32px; overflow: hidden; background: rgba(15, 23, 22, .92); cursor: zoom-out; }
.image-lightbox[hidden] { display: none; }
.image-lightbox__figure { display: grid; max-width: min(94vw, 1500px); max-height: calc(100vh - 64px); margin: 0; place-items: center; }
.image-lightbox__image { display: block; max-width: 100%; max-height: calc(100vh - 112px); border-radius: 8px; box-shadow: 0 20px 65px rgba(0, 0, 0, .45); cursor: default; object-fit: contain; user-select: none; touch-action: none; will-change: transform; }
.image-lightbox--scaled .image-lightbox__image { cursor: grab; }
.image-lightbox--dragging .image-lightbox__image { cursor: grabbing; }
.image-lightbox__caption { max-width: min(86vw, 920px); margin-top: 12px; color: #edf4f1; font: 500 13px/1.5 Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif; text-align: center; }
.image-lightbox__close { position: fixed; top: 16px; right: 18px; z-index: 1; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.42); border-radius: 50%; color: #fff; background: rgba(0,0,0,.24); font-size: 27px; line-height: 1; cursor: pointer; }
.image-lightbox__close:hover, .image-lightbox__close:focus-visible { border-color: #fff; background: rgba(255,255,255,.18); outline: none; }
@media (max-width: 620px) { .image-lightbox { padding: 18px; } .image-lightbox__figure { max-width: 100%; max-height: calc(100vh - 36px); } .image-lightbox__image { max-height: calc(100vh - 88px); } }
.ai-assistant-strip { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 18px; margin-top: 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.ai-assistant-strip__intro { display: flex; align-items: baseline; gap: 9px; white-space: nowrap; }
.ai-assistant-strip__intro strong { color: var(--accent); font-size: 15px; }
.ai-assistant-strip__intro .status { margin: 0; font-size: 11px; }
.ai-assistant-form { display: flex; gap: 8px; }
.ai-assistant-form input { min-width: 0; flex: 1; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: #fff; outline: 0; }
.ai-assistant-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-assistant-form .button-primary { padding: 0 15px; border: 1px solid var(--accent); border-radius: var(--radius); color: #fff; background: var(--accent); }
.ai-assistant-messages { grid-column: 1 / -1; min-height: 0; max-height: 360px; margin: 0; padding-top: 2px; }
@media (max-width: 700px) { .ai-assistant-strip { grid-template-columns: 1fr; gap: 8px; } .ai-assistant-form { width: 100%; } }

.home-search-wrap { position: relative; }
.home-search-suggestions { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; left: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 14px 28px rgba(31, 45, 40, .14); }
.home-search-suggestion { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.home-search-suggestion:last-child { border-bottom: 0; }
.home-search-suggestion:hover, .home-search-suggestion.is-active { background: var(--accent-soft); }
.home-search-suggestion strong { display: block; color: var(--accent); font-size: 14px; }
.home-search-suggestion small { display: block; margin-top: 1px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.knowledge-map { position: relative; overflow: hidden; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfb; box-shadow: var(--shadow); }
.knowledge-map::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .42; background-image: radial-gradient(#cbd6d1 1px, transparent 1px); background-size: 18px 18px; }
.knowledge-map-grid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.knowledge-map-branch { position: relative; min-width: 0; }
.knowledge-map-branch.is-root { padding: 8px; border: 1px solid #d6e0db; border-radius: 12px; background: rgba(255, 255, 255, .92); box-shadow: 0 8px 20px rgba(31, 45, 40, .05); }
.knowledge-map-children { position: relative; display: grid; gap: 9px; margin: 11px 0 0 17px; padding: 0 0 0 18px; border-left: 1px solid #9bb8b0; }
.knowledge-map-children::before { content: ""; position: absolute; top: 0; left: -1px; width: 18px; height: 1px; background: #9bb8b0; }
.knowledge-map-node { position: relative; display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 9px 11px; border: 1px solid #d9e2de; border-radius: 9px; color: var(--text); background: #fff; box-shadow: 0 4px 12px rgba(31, 45, 40, .04); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.knowledge-map-node:hover, .knowledge-map-node:focus-visible { border-color: var(--accent); box-shadow: 0 8px 17px rgba(23, 107, 112, .13); outline: 0; transform: translateY(-1px); }
.knowledge-map-node--category { border-color: #b8d1c9; background: #f3faf7; }
.knowledge-map-node--article { margin-left: 6px; }
.knowledge-map-node--article::before { content: ""; position: absolute; top: 50%; left: -25px; width: 18px; height: 1px; background: #9bb8b0; }
.knowledge-map-node strong { display: block; color: #183c37; font-size: 13px; line-height: 1.35; }
.knowledge-map-node small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-map-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #dff0eb; }
.knowledge-map-node--article .knowledge-map-dot { width: 6px; height: 6px; margin-top: 6px; background: #b5783f; box-shadow: 0 0 0 3px #f6eadc; }
@media (max-width: 760px) { .knowledge-map { padding: 14px; } .knowledge-map-grid { grid-template-columns: 1fr; } .knowledge-map-node--article { margin-left: 0; } }
