/* AI 知识地图 — 样式 */

:root {
  --bg:        #0b1118;
  --bg-panel:  #121c25;
  --bg-raise:  #1b2934;
  --line:      #2b3b47;
  --line-soft: #21303b;
  --fg:        #e5ecee;
  --fg-dim:    #a7b7c3;
  --fg-faint:  #90a3b2;
  --accent:    #7aa2d8;
  --controls-width: 224px;
  --lyr-base:     #6b8cbe;
  --lyr-emerging: #d3a05a;
  --lyr-news:     #cf6f6f;
}

.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;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--fg);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

#app { display: flex; flex-direction: column; height: 100%; }

/* ───────── 顶栏 ───────── */
#topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 0 16px; height: 52px; flex: 0 0 52px;
  background: var(--bg-panel); border-bottom: 1px solid var(--line);
  z-index: 30;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark { color: var(--accent); font-size: 17px; }
.brand-name { font-weight: 600; letter-spacing: .04em; }
.brand-ver  { color: var(--fg-faint); font-size: 11px; }
.mode-nav { display: flex; gap: 3px; padding: 3px; background: #15181e; border: 1px solid var(--line);
            border-radius: 8px; }
.mode-nav-btn { border: 0; border-radius: 5px; padding: 4px 10px; color: var(--fg-faint);
                background: transparent; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.mode-nav-btn:hover { color: var(--fg); background: var(--bg-raise); }
.mode-nav-btn.active { color: #eaf2ff; background: #33435b; box-shadow: inset 0 0 0 1px #486180; }

/* ───────── 软件模式 ───────── */
#cy.hidden, #legend.hidden { display: none; }
#software-view { position: absolute; inset: 0; overflow-y: auto; padding: 24px 28px 60px;
                 background: var(--bg); z-index: 6; }
#software-view.hidden { display: none; }
.sw-head h2 { margin: 0 0 4px; font-size: 20px; }
.sw-head p { margin: 0 0 20px; color: var(--fg-faint); font-size: 13px; }
.sw-head .xref { cursor: default; }
.sw-cat { margin-bottom: 26px; }
.sw-cat h3 { font-size: 14px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
             border-bottom: 1px solid var(--line-soft); padding-bottom: 7px; }
.sw-cat h3 em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--fg-faint); }
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.sw-card { background: var(--bg-raise); border: 1px solid var(--line); border-left-width: 3px;
           border-radius: 6px; padding: 11px 13px; cursor: pointer; transition: border-color .12s; }
.sw-card:hover { border-color: var(--accent); }
.sw-name { font-size: 14px; font-weight: 600; color: var(--fg); }
.sw-by { font-size: 11px; color: var(--fg-faint); margin: 1px 0 6px; }
.sw-sum { font-size: 12px; color: var(--fg-dim); line-height: 1.6; }

/* ───────── 专业资料库 ───────── */
#library-view { position: absolute; inset: 0; overflow-y: auto; padding: 24px 28px 60px;
                background: var(--bg); z-index: 7; }
#library-view.hidden { display: none; }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
            margin: 0 auto 20px; max-width: 1180px; }
.lib-head h2 { margin: 0 0 4px; font-size: 20px; }
.lib-head p { margin: 0; color: var(--fg-faint); font-size: 13px; }
.lib-count { color: var(--accent); font-size: 12px; white-space: nowrap; }
.lib-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px;
              max-width: 1180px; margin: 0 auto; }
.lib-sources { align-self: start; position: sticky; top: 0; padding: 8px;
               border: 1px solid var(--line); border-radius: 9px; background: var(--bg-panel); }
.lib-source { width: 100%; display: grid; grid-template-columns: 25px 1fr auto; gap: 7px;
              align-items: center; border: 0; border-radius: 6px; padding: 7px 8px;
              color: var(--fg-dim); background: transparent; text-align: left; font: inherit; cursor: pointer; }
.lib-source:hover { color: var(--fg); background: var(--bg-raise); }
.lib-source.active { color: var(--fg); background: #252c36; box-shadow: inset 2px 0 var(--source-color, var(--accent)); }
.lib-source-order { font: 600 11px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--source-color); }
.lib-source-label { font-size: 12px; }
.lib-source-count { color: var(--fg-faint); font-size: 10px; }
.lib-subnav { margin-bottom: 13px; padding: 12px; border: 1px solid var(--line);
              border-radius: 8px; background: var(--bg-panel); }
.lib-subnav-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 9px; }
.lib-subnav-head b { display: block; color: var(--fg); font-size: 12px; }
.lib-subnav-head span { display: block; margin-top: 1px; color: var(--fg-faint); font-size: 10px; }
.lib-subnav-head em { color: var(--fg-faint); font-style: normal; font-size: 10px; white-space: nowrap; }
.lib-sub-overview { display: flex; align-items: center; gap: 12px; color: var(--fg-faint); font-size: 11px; }
.lib-sub-select { flex: 1; min-width: 220px; padding: 6px 9px; border: 1px solid var(--line);
                  border-radius: 5px; background: var(--bg-raise); color: var(--fg); font: inherit; font-size: 11px; }
.lib-sub-select:focus { outline: none; border-color: var(--accent); }
.lib-subchips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-subchip { border: 1px solid var(--line); border-radius: 14px; padding: 3px 8px;
               background: var(--bg-raise); color: var(--fg-dim); font: inherit; font-size: 10px; cursor: pointer; }
.lib-subchip:hover { color: var(--fg); border-color: var(--source-color, var(--accent)); }
.lib-subchip.active { color: #eaf2ff; border-color: var(--accent); background: #2a3b51; }
.lib-subchip span { margin-left: 3px; color: var(--fg-faint); font-size: 9px; }
.lib-topic-nav { margin: -3px 0 13px; padding: 12px; border: 1px solid #36506a; border-radius: 8px;
                 background: linear-gradient(135deg, #182630, #111b24); }
.lib-topic-head { margin-bottom: 9px; }
.lib-topic-head b { display: block; color: var(--fg); font-size: 12px; }
.lib-topic-head span { display: block; margin-top: 2px; color: var(--fg-faint); font-size: 10px; }
.lib-topic-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.lib-topic-chip { border: 1px solid #3d5366; border-radius: 16px; padding: 4px 9px;
                  background: #12202a; color: var(--fg-dim); font: inherit; font-size: 10px; cursor: pointer; }
.lib-topic-chip:hover { color: var(--fg); border-color: var(--accent); }
.lib-topic-chip.active { color: #f2f8ff; border-color: var(--accent); background: #29465d; }
.lib-topic-chip span { margin-left: 3px; color: #91aac0; font-size: 9px; }
.lib-platform-profile { position: relative; margin-top: 13px; padding: 15px 16px 12px;
                        border: 1px solid #354052; border-radius: 8px;
                        background: linear-gradient(145deg, #202630, #1b1f26); overflow: hidden; }
.lib-platform-profile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
                                background: var(--accent); opacity: .8; }
.lib-profile-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.lib-profile-title span { color: var(--accent); font-size: 9px; letter-spacing: .12em; }
.lib-profile-title h3 { margin: 0; color: var(--fg); font-size: 17px; line-height: 1.35; }
.lib-profile-link, .lib-profile-no-link { flex: 0 0 auto; margin-top: 3px; padding: 4px 8px;
                                         border-radius: 5px; font-size: 10px; }
.lib-profile-link { border: 1px solid #496486; color: #b9d5fb; text-decoration: none; }
.lib-profile-link:hover { background: #29394d; }
.lib-profile-no-link { color: var(--fg-faint); background: #171a20; }
.lib-profile-intro { max-width: 1040px; margin: 11px 0 13px; padding: 12px 14px;
                     border-left: 2px solid #55779f; background: rgba(28,35,45,.62); }
.lib-profile-intro span { color: #8eabd0; font-size: 9px; letter-spacing: .1em; }
.lib-profile-intro p { margin: 4px 0 0; color: #d1d7e0; font-size: 12px; line-height: 1.85; }
.lib-profile-strengths { margin-bottom: 10px; }
.lib-profile-strengths h4 { margin: 0 0 6px; color: var(--fg); font-size: 11px; }
.lib-profile-strengths > div { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.lib-profile-strengths p { position: relative; margin: 0; padding: 8px 9px 8px 25px;
                           border: 1px solid #303946; border-radius: 5px; background: #191d23;
                           color: var(--fg-dim); font-size: 10px; line-height: 1.55; }
.lib-profile-strengths p::before { content: "◆"; position: absolute; left: 9px; top: 9px;
                                   color: #6e90b8; font-size: 7px; }
.lib-profile-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0 0 10px; }
.lib-profile-facts > div { padding: 8px 9px; border-radius: 5px; background: rgba(15,17,21,.48); }
.lib-profile-facts dt { margin-bottom: 2px; color: var(--fg-faint); font-size: 9px; }
.lib-profile-facts dd { margin: 0; color: var(--fg-dim); font-size: 10px; line-height: 1.55; }
.lib-profile-sections { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lib-profile-sections section { padding: 11px 12px; border-radius: 6px; background: rgba(15,17,21,.55); }
.lib-profile-sections h4 { margin: 0 0 6px; color: var(--fg); font-size: 11px; }
.lib-profile-sections ul { margin: 0; padding-left: 17px; color: var(--fg-dim); font-size: 11px; line-height: 1.65; }
.lib-profile-sections li + li { margin-top: 3px; }
.lib-profile-caution { margin-top: 10px; padding: 9px 11px; border-left: 2px solid #b99355;
                       border-radius: 3px; background: rgba(128,91,40,.12); }
.lib-profile-caution b { color: #d1aa6c; font-size: 10px; }
.lib-profile-caution p { margin: 2px 0 0; color: #b9b0a1; font-size: 11px; line-height: 1.65; }
.lib-platform-profile footer { margin-top: 9px; color: #667182; font-size: 9px; text-align: right; }
.lib-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.lib-search { flex: 1; min-width: 160px; padding: 7px 10px; border: 1px solid var(--line);
              border-radius: 6px; background: var(--bg-raise); color: var(--fg); font: inherit; }
.lib-search:focus { outline: none; border-color: var(--accent); }
.lib-filter-note { color: var(--fg-faint); font-size: 11px; white-space: nowrap; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 12px; }
.lib-card { min-height: 210px; display: flex; flex-direction: column; padding: 14px;
            border: 1px solid var(--line); border-top: 3px solid var(--source-color);
            border-radius: 8px; background: var(--bg-raise); cursor: pointer;
            transition: transform .12s, border-color .12s, background .12s; }
.lib-card:hover { transform: translateY(-2px); border-color: var(--source-color); background: #242932; }
.lib-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lib-badge { padding: 1px 7px; border: 1px solid color-mix(in srgb, var(--source-color) 55%, transparent);
             border-radius: 10px; color: var(--source-color); font-size: 10px; }
.lib-subbadge { padding: 1px 6px; border-radius: 10px; background: #171a20; color: var(--fg-dim); font-size: 10px; }
.lib-topicbadge { padding: 1px 6px; border: 1px solid #3d5366; border-radius: 10px; color: #b9d3e8; font-size: 9px; }
.lib-tier { margin-left: auto; color: var(--fg-faint); font: 600 10px ui-monospace, Consolas, monospace; }
.lib-discovery { color: #d0b15c; font-size: 10px; }
.lib-title { margin: 0 0 4px; font-size: 15px; line-height: 1.45; color: var(--fg); }
.lib-publisher { color: var(--fg-faint); font-size: 11px; margin-bottom: 9px; }
.lib-summary { color: var(--fg-dim); font-size: 12px; line-height: 1.65; margin: 0 0 12px; }
.lib-card-foot { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.lib-tag { padding: 1px 6px; border-radius: 4px; background: #191c22; color: var(--fg-faint); font-size: 10px; }
.lib-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 16px; }
.lib-pager[hidden] { display: none; }
.lib-page { min-width: 32px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: transparent; color: var(--fg); font-size: 12px; cursor: pointer; }
.lib-page:hover:not(:disabled) { border-color: var(--accent); }
.lib-page.active { border-color: var(--accent); background: var(--accent); color: var(--bg, #14161a); cursor: default; }
.lib-page:disabled { opacity: .4; cursor: default; }
.lib-page-gap { color: var(--fg-faint); font-size: 12px; padding: 0 2px; }
.lib-empty { padding: 45px 20px; border: 1px dashed var(--line); border-radius: 8px;
             color: var(--fg-faint); text-align: center; }
.lib-detail-meta { display: grid; grid-template-columns: 76px 1fr; gap: 5px 10px; font-size: 12px; }
.lib-detail-meta dt { color: var(--fg-faint); }
.lib-detail-meta dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }
.lib-source-link { display: inline-block; margin-top: 14px; padding: 6px 10px; border: 1px solid var(--accent);
                   border-radius: 5px; color: #b9d5fb; text-decoration: none; font-size: 12px; }
.lib-source-link:hover { background: #24354a; }

@media (max-width: 820px) {
  #topbar { gap: 8px; padding: 0 10px; }
  .brand-ver { display: none; }
  .mode-nav-btn { padding: 4px 7px; }
  .search-wrap { max-width: none; }
  #library-view { padding: 16px 14px 50px; }
  .lib-layout { grid-template-columns: 1fr; }
  .lib-sources { position: static; display: flex; overflow-x: auto; gap: 3px; }
  .lib-source { width: auto; min-width: max-content; grid-template-columns: 20px auto auto; }
  .lib-sub-overview { align-items: stretch; flex-direction: column; gap: 7px; }
  .lib-sub-select { width: 100%; min-width: 0; }
  .lib-profile-sections { grid-template-columns: 1fr; }
  .lib-profile-strengths > div, .lib-profile-facts { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .brand-name, .topbar-actions { display: none; }
  .mode-nav { flex: 0 0 auto; }
  .mode-nav-btn { font-size: 11px; }
  .lib-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .lib-grid { grid-template-columns: 1fr; }
  .lib-profile-title { flex-direction: column; }
}

.search-wrap { position: relative; flex: 1; max-width: 380px; }
.sr-more,.sr-directory{display:block;box-sizing:border-box;width:100%;padding:12px;text-align:start;min-height:44px;border:0;border-top:1px solid #ffffff25;background:#142537;color:#b8e5ff;font:inherit;cursor:pointer}
.site-help summary{cursor:pointer;min-height:44px;display:list-item;padding:10px 0}.site-help p{line-height:1.75}.site-help a,.reading-feedback a{color:var(--accent)}.reading-feedback{grid-column:1/-1;margin:20px auto;padding:12px 24px;max-width:800px}.reading-feedback a{display:inline-flex;align-items:center;min-height:44px}
#search {
  width: 100%; padding: 7px 12px;
  background: var(--bg-raise); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px; outline: none;
  font-family: inherit; font-size: 13px;
}
#search:focus { border-color: var(--accent); }
#search-results {
  position: absolute; top: 38px; left: 0; right: 0;
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: 6px; max-height: 300px; overflow-y: auto;
  display: none; z-index: 40;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
#search-results.open { display: block; }
.sr-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover, .sr-item.sel { background: #2a303a; }
.sr-title { font-size: 13px; }
.sr-sum { font-size: 11px; color: var(--fg-faint); margin-top: 2px;
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-none { padding: 10px 12px; color: var(--fg-faint); font-size: 12px; }

.topbar-actions { display: flex; gap: 8px; margin-left: auto; }
.btn {
  padding: 6px 12px; background: var(--bg-raise); color: var(--fg-dim);
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  font-family: inherit; font-size: 12px;
}
.btn:hover { color: var(--fg); border-color: var(--accent); }
.btn:focus-visible, .controls-toggle:focus-visible, .settings-close:focus-visible, .settings-select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
}
.icon-btn svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linejoin: round;
}

.locale-fallback-banner {
  flex: 0 0 auto; padding: 7px 18px; border-bottom: 1px solid rgba(228,184,93,.28);
  background: rgba(228,184,93,.08); color: #d9bd7a; font-size: 11px; line-height: 1.45;
  text-align: center;
}
.locale-fallback-banner.hidden { display: none; }

/* ───────── 布局 ───────── */
#main { position: relative; display: flex; flex: 1; min-height: 0; }

/* ───────── 左侧控制栏 ───────── */
#controls {
  position: absolute; inset: 0 auto 0 0; z-index: 30;
  width: var(--controls-width); flex: 0 0 var(--controls-width); padding: 4px 0 24px;
  background: var(--bg-panel); border-right: 1px solid var(--line);
  overflow-y: auto;
  transition: width .18s ease, flex-basis .18s ease, border-color .18s ease;
}
#controls.hidden { display: none; }
#app.controls-collapsed #controls:not(.hidden) {
  width: 0; flex-basis: 0; padding-left: 0; padding-right: 0;
  border-right-color: transparent; overflow: hidden;
}
.controls-toggle {
  position: absolute; left: var(--controls-width); top: 24px; z-index: 35;
  width: 26px; height: 54px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0;
  background: rgba(26,29,35,.96); color: var(--fg-faint); cursor: pointer;
  box-shadow: 5px 0 16px rgba(0,0,0,.18);
  transition: left .18s ease, color .12s ease, border-color .12s ease, background .12s ease;
}
.controls-toggle:hover { color: var(--fg); border-color: #465163; background: #222731; }
.controls-toggle.hidden { display: none; }
.controls-toggle svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease;
}
#app.controls-collapsed .controls-toggle { left: 0; }
#app.controls-collapsed .controls-toggle svg { transform: rotate(180deg); }
.ctl-group { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.ctl-group h3 {
  margin: 0 0 8px; font-size: 11px; font-weight: 600;
  color: var(--fg-faint); letter-spacing: .12em; text-transform: uppercase;
}
.ctl-toggle-heading button {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 0; border: 0; background: transparent; color: inherit;
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; text-align: left;
}
.ctl-toggle-heading button:hover { color: var(--fg); }
.ctl-chevron { font-size: 15px; line-height: 1; transition: transform .16s ease; }
.ctl-toggle-heading button[aria-expanded="false"] .ctl-chevron { transform: rotate(-90deg); }
.ctl-hint { margin: -4px 0 8px; font-size: 11px; color: var(--fg-faint); line-height: 1.5; }

.chk {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 0; cursor: pointer; font-size: 13px; color: var(--fg-dim);
}
.chk:hover { color: var(--fg); }
.chk input { accent-color: var(--accent); cursor: pointer; margin: 0; }
.chk em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--fg-faint); }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 9px; }
.dash { width: 14px; height: 0; border-top: 2px solid; display: inline-block; flex: 0 0 14px; }
.domain-group + .domain-group { border-top: 1px solid var(--line-soft); }
.domain-row { display: flex; align-items: center; gap: 4px; }
.domain-filter { flex: 1; min-width: 0; }
.domain-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-expand {
  width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 4px; background: transparent;
  color: var(--fg-faint); font: inherit; cursor: pointer;
}
.domain-expand:hover { color: var(--fg); background: var(--bg-raise); }
.domain-expand span { transition: transform .16s ease; }
.domain-expand[aria-expanded="true"] span { transform: rotate(180deg); }
.domain-node-list {
  max-height: 220px; overflow-y: auto; margin: 0 0 6px 20px;
  padding: 2px 2px 4px 6px; border-left: 1px solid var(--line);
}
.domain-node {
  width: 100%; display: flex; align-items: center; gap: 7px;
  padding: 5px 6px; border: 0; border-radius: 4px; background: transparent;
  color: var(--fg-dim); font: inherit; font-size: 11.5px; text-align: left; cursor: pointer;
}
.domain-node:hover { color: var(--fg); background: var(--bg-raise); }
.domain-node span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-expand:focus-visible, .domain-node:focus-visible, .ctl-toggle-heading button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* 视图范围切换 */
.seg { display: flex; gap: 0; margin-bottom: 8px; }
.seg button {
  flex: 1; padding: 5px 0; font-size: 12px; font-family: inherit; cursor: pointer;
  background: var(--bg-raise); color: var(--fg-faint);
  border: 1px solid var(--line); border-right-width: 0;
}
.seg button:first-child { border-radius: 5px 0 0 5px; }
.seg button:last-child  { border-radius: 0 5px 5px 0; border-right-width: 1px; }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--accent); color: #12141a; border-color: var(--accent); font-weight: 600; }

.scope-status { font-size: 11px; color: var(--fg-faint); margin-bottom: 8px; line-height: 1.5; }
.mini.wide { width: 100%; }
.mini:disabled { opacity: .4; cursor: default; }
.mini:disabled:hover { color: var(--fg-faint); border-color: var(--line); }

.edge-actions { display: flex; gap: 5px; margin-bottom: 8px; }
.mini {
  flex: 1; padding: 3px 0; font-size: 11px; font-family: inherit;
  background: var(--bg-raise); color: var(--fg-faint);
  border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
}
.mini:hover { color: var(--fg); border-color: var(--accent); }

.range { display: flex; align-items: center; gap: 8px; padding: 6px 0;
         font-size: 12px; color: var(--fg-dim); }
.range input { flex: 1; accent-color: var(--accent); }

/* 学习进度 */
.learning-overview {
  display: flex; align-items: baseline; justify-content: space-between;
  color: var(--fg-dim); margin-bottom: 7px;
}
.learning-overview strong { color: var(--fg); font-size: 20px; line-height: 1; }
.learning-overview span { font-size: 11px; color: var(--fg-faint); }
.learning-progress {
  height: 5px; overflow: hidden; margin-bottom: 10px;
  border-radius: 999px; background: var(--bg-raise);
}
.learning-progress span {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: var(--accent); transition: width .2s ease;
}
.learning-group { border-top: 1px solid var(--line-soft); }
.learning-group summary {
  display: flex; align-items: center; gap: 6px; padding: 8px 0;
  color: var(--fg-dim); font-size: 12px; cursor: pointer; list-style-position: inside;
}
.learning-group summary:hover { color: var(--fg); }
.learning-group summary em {
  margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--fg-faint);
  background: var(--bg-raise); border-radius: 10px; padding: 0 7px;
}
.learning-node-list { max-height: 168px; overflow-y: auto; padding: 0 2px 7px 0; }
.learning-node {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 5px 4px;
  border: 0; border-radius: 4px; background: transparent; color: var(--fg-dim);
  font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.learning-node:hover { color: var(--fg); background: var(--bg-raise); }
.learning-node span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learning-empty { padding: 4px 2px 10px; color: var(--fg-faint); font-size: 11px; }
.learning-storage-note { margin: 7px 0 0; }
.official-path-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; margin: 2px 0 10px; padding: 8px 9px;
  border: 1px solid #6a552f; border-radius: 6px; background: rgba(228,184,93,.06);
  color: #e4b85d; font: inherit; cursor: pointer;
}
.official-path-toggle:hover, .official-path-toggle.on {
  border-color: #e4b85d; background: rgba(228,184,93,.13);
}
.official-path-toggle span { font-size: 12px; font-weight: 650; }
.official-path-toggle em { color: var(--fg-faint); font-size: 9.5px; font-style: normal; }
.official-path-note {
  margin: -2px 0 10px; padding: 8px 9px; border-left: 2px solid #e4b85d;
  background: rgba(228,184,93,.045); color: var(--fg-faint); font-size: 10.5px; line-height: 1.55;
}
.official-path-note.hidden { display: none; }

/* ───────── 图 ───────── */
#stage { flex: 1; position: relative; min-width: 0; }
#cy { position: absolute; inset: 0; }
#map-side-curtains { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(circle var(--curtain-radius, 60vmin) at 50% 50%, transparent 78%, var(--bg) 100%); }
.map-curtain-stars {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  /* Keep stars inside the dark curtain, leaving the graph's focal area clear. */
  -webkit-mask-image: radial-gradient(circle var(--curtain-radius, 60vmin) at 50% 50%, transparent 85%, #000 106%);
  mask-image: radial-gradient(circle var(--curtain-radius, 60vmin) at 50% 50%, transparent 85%, #000 106%);
}
.map-curtain-stars::before {
  content: ''; position: absolute; inset: -5%;
  /* Smooth gas clouds stay separate from the crisp, viewport-resolution stars. */
  background: radial-gradient(ellipse at 4% 15%, rgba(99,117,195,.28), transparent 36%), radial-gradient(ellipse at 16% 76%, rgba(136,106,190,.25), transparent 30%), radial-gradient(ellipse at 91% 61%, rgba(112,94,179,.3), transparent 38%), linear-gradient(115deg, rgba(48,61,113,.3), rgba(41,35,76,.14) 48%, rgba(63,62,117,.32));
  opacity: .8;
  animation: map-nebula-breathe 28s ease-in-out infinite alternate;
}
.map-star-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-star-field {
  position: absolute; inset: -18px;
  animation: map-star-drift 32s ease-in-out infinite alternate;
}
.map-star {
  position: absolute; width: var(--star-size); height: var(--star-size);
  border-radius: 50%; background: #c7dafa; opacity: .65;
  animation: map-star-twinkle var(--star-duration) ease-in-out var(--star-delay) infinite;
}
.map-star-bright { background: #edf5ff; box-shadow: 0 0 7px 2px rgba(146,180,236,.42); }
.map-star-bright::after {
  content: ''; position: absolute; inset: -3px 1px; border-radius: 50%;
  background: rgba(206,223,255,.65); transform: rotate(25deg);
}
.map-star-glimmer {
  position: absolute; width: 70px; height: 1px; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(185,215,255,.8));
  animation: map-glimmer-pass 16s ease-out infinite;
}
.map-star-glimmer-left { left: 5%; top: 27%; animation-delay: -3s; }
.map-star-glimmer-right { right: 14%; top: 62%; animation-delay: -11s; }
.map-stars-paused .map-star-field, .map-stars-paused .map-star,
.map-stars-paused .map-star-glimmer, .map-stars-paused .map-curtain-stars::before { animation-play-state: paused; }
@keyframes map-star-twinkle { 0%, 100% { opacity: .12; } 50% { opacity: 1; } }
@keyframes map-star-drift { from { transform: translate3d(-4px, 12px, 0); } to { transform: translate3d(9px, -12px, 0); } }
@keyframes map-nebula-breathe { from { opacity: .72; transform: scale(1) translate3d(-4px, 3px, 0); } to { opacity: .92; transform: scale(1.045) translate3d(4px, -3px, 0); } }
@keyframes map-glimmer-pass {
  0%, 78%, 100% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-32deg); }
  81% { opacity: .65; }
  91%, 99% { opacity: 0; transform: translate3d(100px, -62px, 0) rotate(-32deg); }
}
@media (max-width: 700px) { .map-star:nth-child(2n) { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .map-star-field, .map-star, .map-curtain-stars::before { animation: none; }
  .map-star-glimmer { display: none; }
}

/* ───────── 设置 ───────── */
.settings-overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
}
.settings-overlay.hidden { display: none; }
.settings-backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
  background: rgba(6,8,12,.68); backdrop-filter: blur(3px); cursor: default;
}
.settings-dialog {
  max-height: calc(100dvh - 32px); overflow-y: auto;
  position: relative; width: min(440px, 100%); overflow: hidden;
  border: 1px solid #363d49; border-radius: 12px; background: var(--bg-panel);
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.settings-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 20px 16px; border-bottom: 1px solid var(--line);
}
.settings-eyebrow { display: block; color: var(--accent); font-size: 9px; letter-spacing: .16em; }
.settings-head h2 { margin: 1px 0 0; color: var(--fg); font-size: 19px; font-weight: 650; }
.settings-close {
  width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg-raise); color: var(--fg-dim); font: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
.settings-close:hover { color: var(--fg); border-color: var(--accent); }
.settings-body { padding: 18px 20px 22px; }
.settings-group h3 {
  margin: 0 0 8px; color: var(--fg-faint); font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raise);
}
.settings-row strong { display: block; color: var(--fg); font-size: 13px; font-weight: 600; }
.settings-row div > span { display: block; margin-top: 1px; color: var(--fg-faint); font-size: 11px; }
.settings-select {
  flex: 0 0 auto; min-width: 178px; min-height: 34px; padding: 6px 32px 6px 10px;
  border: 1px solid #44546b; border-radius: 6px; background: #283447; color: #dceaff;
  font: inherit; font-size: 12px; cursor: pointer; color-scheme: dark;
}
.settings-select:hover:not(:disabled) { border-color: var(--accent); }
.settings-select:disabled { cursor: wait; opacity: .72; }
.settings-note { margin: 8px 2px 0; color: var(--fg-faint); font-size: 10.5px; }
.settings-status { min-height: 16px; margin: 5px 2px 0; color: #e4b85d; font-size: 10.5px; }

.map-zoom {
  position: absolute; top: 14px; right: 14px; z-index: 8;
  display: grid; grid-template-columns: 38px 58px 38px; align-items: stretch;
  overflow: hidden; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(26,29,35,.94); box-shadow: 0 6px 20px rgba(0,0,0,.28);
}
.map-zoom.hidden { display: none; }
.map-zoom button {
  min-height: 38px; padding: 0; border: 0; background: transparent;
  color: var(--fg-dim); font: 600 21px/1 "Segoe UI", sans-serif; cursor: pointer;
}
.map-zoom button:hover:not(:disabled) { color: var(--fg); background: var(--bg-raise); }
.map-zoom button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
.controls-mobile-label,.map-mobile-hint { display:none; }
#startup-status{position:fixed;inset:auto 16px 16px;z-index:180;max-width:560px;margin:auto;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--bg-panel);color:var(--fg)}
#startup-status[hidden]{display:none}#startup-status p{margin:0 0 12px}#startup-status button,#startup-status a{display:inline-block;margin-right:12px;padding:10px 14px;min-height:44px;box-sizing:border-box}
@media(max-width:720px) {
  #topbar .btn,#topbar .icon-btn,.settings-close,.map-zoom button { min-width:44px; min-height:44px; }
  #controls .chk,.domain-expand,.domain-node,.learning-node { min-height:44px; }
  #controls-toggle { width:108px; height:44px; top:12px; left:8px; border:1px solid var(--line); border-radius:8px; display:flex; gap:6px; padding:8px; }
  #app:not(.controls-collapsed) #controls-toggle { left:min(268px,calc(100vw - 116px)); }
  .controls-mobile-label { display:inline; font-size:13px; white-space:nowrap; }
  .map-mobile-hint { display:block; position:absolute; left:12px; bottom:48px; z-index:4; font-size:12px; line-height:1.6; color:var(--fg-dim); background:#101923ed; padding:6px 8px; border-radius:6px; pointer-events:none; max-width:calc(100% - 24px); }
  #cy.hidden + .map-mobile-hint { display:none; }
}
.map-zoom button:disabled { color: #4f5662; cursor: default; }
.map-zoom output {
  display: flex; align-items: center; justify-content: center;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  color: var(--fg-faint); font-size: 11px; font-variant-numeric: tabular-nums;
}

#legend {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(26,29,35,.92); border: 1px solid var(--line);
  border-radius: 6px; padding: 9px 12px; font-size: 11px; color: var(--fg-faint);
  pointer-events: none; line-height: 1.9;
}
#legend b { color: var(--fg-dim); font-weight: 500; }

#empty-hint {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--fg-faint); font-size: 13px;
}
#empty-hint.hidden { display: none; }

/* ───────── 右侧详情 ───────── */
#detail {
  width: 400px; flex: 0 0 400px; position: relative;
  background: var(--bg-panel); border-left: 1px solid var(--line);
  overflow-y: auto;
}
#detail.closed { display: none; }
#detail-close {
  position: absolute; top: 12px; right: 14px; z-index: 5;
  background: none; border: none; color: var(--fg-faint);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}
#detail-close:hover { color: var(--fg); }
#detail-body { padding: 20px 22px 40px; }
#detail.graph-detail #detail-close { display: none; }
#detail.graph-detail.collapsed { width: 0; flex-basis: 0; border: 0; overflow: hidden; }
#detail.graph-detail.collapsed #detail-body { visibility: hidden; }
.detail-toggle { position: absolute; top: 88px; z-index: 35; width: 26px; height: 54px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; background: var(--bg-panel); color: var(--fg-faint); cursor: pointer; }
.detail-toggle.hidden { display: none; }
.detail-toggle:hover { color: var(--fg); border-color: var(--accent); }
.detail-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.detail-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.detail-toggle[aria-expanded="false"] svg { transform: rotate(180deg); }

.d-domain { font-size: 11px; letter-spacing: .1em; margin-bottom: 8px; }
.mat-tag {
  display: inline-block; margin-left: 8px; padding: 1px 7px;
  font-size: 10px; letter-spacing: .05em; border-radius: 8px;
  color: #d3a05a; border: 1px dashed #d3a05a; background: rgba(211,160,90,.08);
}
.d-title { margin: 0 0 6px; font-size: 21px; font-weight: 600; line-height: 1.3; padding-right: 24px; }
.d-alias { color: var(--fg-faint); font-size: 11px; margin-bottom: 14px; }
.d-summary {
  color: var(--fg); font-size: 14px; line-height: 1.75;
  padding: 12px 14px; background: var(--bg-raise);
  border-left: 2px solid var(--accent); border-radius: 0 5px 5px 0;
  margin-bottom: 20px;
}
.d-sec { margin-bottom: 22px; }
.d-sec h4 {
  margin: 0 0 9px; font-size: 11px; font-weight: 600; color: var(--fg-faint);
  letter-spacing: .12em; text-transform: uppercase;
}
.d-body p { margin: 0 0 11px; color: var(--fg-dim); line-height: 1.8; }
.d-body p:last-child { margin-bottom: 0; }
.d-body strong { color: var(--fg); font-weight: 600; }
.d-body code {
  background: var(--bg-raise); padding: 1px 5px; border-radius: 3px;
  font-size: 12px; color: #b8cfe8;
}
.d-body .quote {
  border-left: 2px solid var(--line); padding-left: 12px;
  color: var(--fg-faint); font-size: 13px;
}

/* 正文表格 */
.d-table {
  width: 100%; border-collapse: collapse; margin: 4px 0 14px;
  font-size: 12.5px; display: block; overflow-x: auto;
}
.d-table th, .d-table td {
  border: 1px solid var(--line); padding: 6px 9px;
  text-align: left; vertical-align: top;
}
.d-table th { background: var(--bg-raise); color: var(--fg); font-weight: 600; font-size: 11.5px; }
.d-table td { color: var(--fg-dim); }

/* 正文里的内联概念跳转 */
.xref {
  color: var(--accent); cursor: pointer;
  border-bottom: 1px dashed rgba(122,162,216,.45);
}
.xref:hover { border-bottom-style: solid; background: rgba(122,162,216,.1); }
.xref-bad { color: #c86f6f; border-bottom: 1px dotted #c86f6f; cursor: help; }

.case { background: var(--bg-raise); border-radius: 6px; padding: 11px 13px; margin-bottom: 9px; }
.case-t { font-size: 12px; font-weight: 600; color: var(--fg); margin-bottom: 5px; }
.case-x { font-size: 12.5px; color: var(--fg-dim); line-height: 1.75; }
.case-x strong { color: var(--fg); }
.case-x code { background: #191c22; padding: 1px 4px; border-radius: 3px; font-size: 11.5px; }

.rel { display: flex; align-items: baseline; gap: 8px; padding: 6px 0;
       border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.rel:last-child { border-bottom: none; }
.rel-type { flex: 0 0 62px; font-size: 10.5px; padding: 1px 0; text-align: center;
            border-radius: 3px; color: #12141a; font-weight: 600; }
.rel-to { color: var(--accent); cursor: pointer; }
.rel-to:hover { text-decoration: underline; }
.rel-lbl { color: var(--fg-faint); font-size: 11px; margin-left: auto; }

.d-asof { font-weight: 400; color: var(--fg-faint); font-size: 10px; }
.d-model { display: flex; align-items: baseline; gap: 8px; padding: 6px 0;
           border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.d-model:last-child { border-bottom: none; }
.d-model b { color: var(--fg); font-weight: 600; }
.d-model span { color: var(--fg-faint); font-size: 11px; margin-left: auto; text-align: right; }

.act { border-left: 2px solid var(--lyr-news); padding: 2px 0 2px 11px; margin-bottom: 11px; }
.act-d { font-size: 10.5px; color: var(--lyr-news); letter-spacing: .06em; }
.act-t { font-size: 12.5px; font-weight: 600; margin: 2px 0 3px; }
.act-x { font-size: 12px; color: var(--fg-dim); line-height: 1.7; }

.src a { color: var(--accent); font-size: 12px; text-decoration: none; }
.src a:hover { text-decoration: underline; }

.d-empty { color: var(--fg-faint); font-size: 12px; }

/* ───────── 理解原理 · 深读页按钮（详情面板内） ───────── */
.dd-open {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-raise); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 5px;
  font-size: 11.5px; padding: 3px 10px; cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.dd-open:hover { background: var(--accent); color: #12141a; }
.d-domain { display: flex; align-items: center; gap: 8px; }

/* ───────── 理解原理 · 全屏阅读视图 ───────── */
#deepdive { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
            background: var(--bg); }
#deepdive.hidden { display: none; }
.dd-top { display: flex; align-items: center; gap: 14px; height: 50px; flex: 0 0 50px;
          padding: 0 16px; background: var(--bg-panel); border-bottom: 1px solid var(--line); }
.dd-back { background: var(--bg-raise); color: var(--fg-dim); border: 1px solid var(--line);
           border-radius: 6px; font-size: 12.5px; padding: 5px 12px; cursor: pointer; font-family: inherit; }
.dd-back:hover { color: var(--fg); border-color: var(--accent); }
.dd-top-name { font-size: 13px; color: var(--fg-faint); }
.dd-provisional .dd-top-name { color: #ff6b6b; font-weight: 700; }
.dd-x { margin-left: auto; background: none; border: none; color: var(--fg-faint);
        font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.dd-x:hover { color: var(--fg); }
.dd-scroll { flex: 1; overflow-y: auto; }
#dd-article { max-width: 780px; margin: 0 auto; padding: 40px 28px 120px; }
.dd-loading { margin: 72px auto; padding: 24px; color: var(--fg-faint); text-align: center; }
.dd-loading-error { color: #e7a09a; }
.view-loading { margin: 80px auto; padding: 24px; color: var(--fg-faint); text-align: center; font-size: 14px; }

/* hero */
.dd-hero { border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 8px; }
.dd-eyebrow { font-size: 11px; letter-spacing: .18em; color: var(--accent); text-transform: uppercase; }
.dd-h1 { font-size: 32px; font-weight: 700; margin: 10px 0 6px; color: var(--fg); letter-spacing: .01em; }
.dd-h1.dd-h1-provisional { color: #ff5f5f; }
.dd-h1.dd-h1-editorial-draft { color: #ff5f5f; }
.dd-provisional-notice { display: flex; flex-direction: column; gap: 3px; margin: 12px 0 14px;
                         padding: 10px 13px; border: 1px solid #9f3a3a; border-radius: 7px;
                         background: rgba(143, 39, 39, .16); color: #f3b4b4; font-size: 12.5px; line-height: 1.6; }
.dd-provisional-notice strong { color: #ff6b6b; font-size: 13px; }
.dd-sub { font-size: 15px; color: var(--fg-dim); }
.dd-ali { font-size: 12px; color: var(--fg-faint); margin-top: 8px; }
.dd-metabar { font-size: 12px; color: var(--fg-faint); margin-top: 6px; }
.dd-thesis { margin-top: 18px; background: var(--bg-raise); border-left: 3px solid var(--accent);
             border-radius: 0 6px 6px 0; padding: 12px 16px; font-size: 14px; line-height: 1.8; color: var(--fg-dim); }
.dd-thesis-l { color: var(--accent); font-weight: 700; margin-right: 6px; }

/* 学习目标 */
.dd-goals { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 8px;
            padding: 16px 20px; margin: 24px 0; }
.dd-goals-h { font-weight: 600; color: var(--fg); margin-bottom: 8px; }
.dd-goals ul { margin: 0; padding-left: 20px; }
.dd-goals li { font-size: 13.5px; line-height: 1.9; color: var(--fg-dim); }

/* 章节 */
.course-contents { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.course-reading, .course-workflow-chapter { scroll-margin-top: 24px; }
.course-reading > h2 { margin-bottom: 20px; }
.course-reading strong { color: var(--fg); font-weight: 600; }
.course-reading .course-prompt-example { margin: 12px 0 24px; padding: 16px 20px; border-left: 3px solid var(--accent); border-radius: 0 7px 7px 0; background: var(--bg-panel); overflow-wrap: anywhere; }
.course-reading .course-prompt-example p:last-child { margin-bottom: 0; }
.course-reading h3[id] { margin-top: 36px; scroll-margin-top: 24px; }
.course-workflow-chapter > .prompt-workflow { margin-top: 24px; }
@media (max-width: 600px) { .course-reading .course-prompt-example { padding: 14px 16px; } .course-contents { column-gap: 18px; } }
#dd-article article, .dd-sec { margin-top: 40px; }
.dd-sec h2 { font-size: 21px; font-weight: 700; color: var(--fg); margin: 0 0 4px;
             padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
             display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dd-n { display: inline-flex; align-items: center; justify-content: center;
        width: 27px; height: 27px; border-radius: 6px; background: var(--lyr-base); color: #12141a;
        font-size: 14px; font-weight: 700; flex: 0 0 auto; }
.dd-sec h3 { font-size: 15.5px; font-weight: 600; color: var(--fg); margin: 26px 0 8px; }
.dd-sec p { font-size: 14.5px; line-height: 1.9; color: var(--fg-dim); margin: 0 0 14px; }

/* 层级徽标 */
.dd-badge { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 10px;
            border: 1px solid var(--line); color: var(--fg-faint); background: var(--bg-raise); }
.dd-badge.intuition { color: #8fb0d8; border-color: #3d5170; }
.dd-badge.math { color: #74b79a; border-color: #35604c; }
.dd-badge.eng { color: #d3a05a; border-color: #6a552f; }

/* 认知链引导句 */
.dd-lead { font-size: 13.5px !important; color: var(--fg-faint) !important; font-style: italic;
           border-left: 2px solid var(--line); padding-left: 12px; margin: 4px 0 18px !important; }

/* 教材式数学公式：代码表达式使用 .dd-code，不与展示公式混排。 */
.dd-formula { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", "Times New Roman", serif; text-align: center;
              background: var(--bg-panel); border: 1px solid var(--line); border-radius: 6px;
              padding: 14px 12px; margin: 6px 0 8px; font-size: 17px; color: var(--fg);
              line-height: 1.9; overflow-x: auto; }
.dd-formula math[display="block"] { display: block; width: max-content; min-width: min-content;
                                    max-width: 100%; margin: 0 auto; font-size: 1.08em; }
.dd-radical {
  display: inline-flex;
  align-items: flex-start;
  vertical-align: -0.16em;
  white-space: nowrap;
  font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", "Times New Roman", serif;
}
.dd-radical::before {
  content: "√";
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  font-size: 1.18em;
  line-height: 1;
  transform: scaleY(1.08);
  transform-origin: right center;
}
.dd-radicand {
  display: inline-block;
  box-sizing: border-box;
  min-width: 0.55em;
  border-top: 1px solid currentColor;
  padding: 0.03em 0.08em 0;
  line-height: 1.18;
}
.dd-formula-note { font-size: 12.5px !important; color: var(--fg-faint) !important; text-align: center;
                   margin: 0 0 16px !important; }
.dd-inline-root { font-family: inherit; font-size: 1em; vertical-align: -0.18em; margin: 0 .04em; }
.dd-inline-root mtext { font-family: inherit; }

/* 正文内联代码 */
#dd-article code { font-family: "SFMono-Regular", "Consolas", "Menlo", monospace;
                   background: var(--bg-raise); border: 1px solid var(--line-soft);
                   border-radius: 4px; padding: 1px 5px; font-size: 13px; color: #cdd6e4; }
.dd-formula code { font-family: inherit; background: none; border: none; padding: 0;
                   color: inherit; font-size: inherit; }
.dd-code {
  box-sizing: border-box; max-width: 100%; overflow-x: auto;
  margin: 8px 0 18px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--bg-panel);
}
.dd-code code {
  display: block; width: max-content; min-width: 100%;
  box-sizing: border-box; padding: 0 !important; border: 0 !important; background: none !important;
  white-space: pre; line-height: 1.75;
}

/* 提示框 */
.dd-note { border-radius: 0 7px 7px 0; padding: 12px 16px; margin: 8px 0 18px;
           font-size: 13.5px; line-height: 1.85; color: var(--fg-dim);
           border-left: 3px solid var(--fg-faint); background: var(--bg-panel); }
.dd-note b { color: var(--fg); }
.dd-note.intuition { border-left-color: #6b8cbe; } .dd-note.intuition b { color: #9cc0e8; }
.dd-note.math { border-left-color: #4f9d78; } .dd-note.math b { color: #7ecaa4; }
.dd-note.eng { border-left-color: #d3a05a; } .dd-note.eng b { color: #e0b877; }
.dd-note.warn { border-left-color: #cf6f6f; background: rgba(207,111,111,.06); } .dd-note.warn b { color: #e39494; }
.dd-note.key { border-left-color: var(--accent); background: rgba(122,162,216,.07); } .dd-note.key b { color: var(--accent); }

/* 图 */
.dd-fig { margin: 20px 0 22px; text-align: center; }
.dd-fig svg { max-width: 100%; height: auto; background: var(--bg-panel);
              border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.dd-fig figcaption { font-size: 12.5px; color: var(--fg-faint); line-height: 1.7; margin-top: 10px; text-align: left; }
.svg-t { fill: var(--fg-faint); font-size: 13px; font-family: inherit; }
.svg-tn { fill: var(--fg); font-size: 15px; font-weight: 600; font-family: inherit; }

/* 表格 */
.dd-table-wrap { overflow-x: auto; }
.dd-table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 13px; }
.dd-table th, .dd-table td { border: 1px solid var(--line); padding: 8px 11px; text-align: left;
                             vertical-align: top; line-height: 1.7; }
.dd-table th { background: var(--bg-raise); color: var(--fg); font-weight: 600; }
.dd-table td { color: var(--fg-dim); }
.dd-table code { font-size: 12px; }
.dd-table .dd-align-center { text-align: center; }
.dd-table .dd-align-right { text-align: right; }

/* 步骤 / 因果链 / 自测 列表 */
.dd-steps, .dd-chain, .dd-quiz { margin: 4px 0 18px; padding-left: 22px; }
.dd-steps li, .dd-chain li, .dd-quiz li { font-size: 14px; line-height: 1.9; color: var(--fg-dim); margin-bottom: 7px; }
.dd-chain li span { color: var(--fg-faint); font-size: 12px; }
.dd-answers { margin: 6px 0 8px; }
.dd-answers summary { cursor: pointer; color: var(--accent); font-size: 13.5px; font-weight: 600; }
.dd-answers ol { margin-top: 12px; padding-left: 22px; }
.dd-answers li { font-size: 13px; line-height: 1.85; color: var(--fg-dim); margin-bottom: 7px; }

/* 来源 */
.dd-src { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 18px;
          font-size: 12.5px; line-height: 1.8; color: var(--fg-faint); }
.dd-src ul { margin: 10px 0 0; padding-left: 20px; }
.dd-sec a { color: var(--accent); }
.dd-sec a:hover { text-decoration: underline; }
.dd-src a { color: var(--accent); text-decoration: none; }
.dd-src a:hover { text-decoration: underline; }
.dd-src-date { margin-top: 8px; }

/* 深读页学习完成按钮 */
.dd-learning-complete {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 44px; padding: 20px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg-panel);
}
.dd-learning-kicker { color: var(--fg); font-size: 15px; font-weight: 650; }
.dd-learning-copy { margin-top: 3px; color: var(--fg-faint); font-size: 12.5px; line-height: 1.7; }
.dd-learning-actions { flex: 0 0 auto; display: flex; align-items: stretch; gap: 10px; }
.dd-learn-btn {
  flex: 0 0 auto; min-width: 126px; padding: 9px 16px;
  border: 1px solid var(--accent); border-radius: 7px;
  background: var(--accent); color: #12141a; font: inherit; font-weight: 650; cursor: pointer;
}
.dd-learn-btn:hover { filter: brightness(1.08); }
.dd-learn-btn.is-learned { background: rgba(122,162,216,.1); color: var(--accent); }
.dd-path-btn {
  flex: 0 1 auto; min-width: 180px; max-width: 290px; display: grid;
  align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg-raise); color: var(--fg); font: inherit; cursor: pointer; text-align: left;
}
.dd-prev-btn { grid-template-columns: auto minmax(0, 1fr); }
.dd-next-btn { grid-template-columns: minmax(0, 1fr) auto; }
.dd-path-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dd-path-copy small { color: var(--fg-faint); font-size: 10.5px; white-space: nowrap; }
.dd-path-copy strong { overflow: hidden; color: var(--accent); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.dd-path-btn > span[aria-hidden="true"] { color: var(--accent); font-size: 16px; }
.dd-path-btn:hover { border-color: var(--accent); background: rgba(122,162,216,.08); }
.dd-learn-btn:focus-visible, .dd-path-btn:focus-visible, .learning-node:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ───────── 软件使用教程页 ───────── */
.tutorial-learning { margin-bottom: 28px; }
.tutorial-layout { display: grid; grid-template-columns: 178px minmax(0, 1fr); gap: 26px;
  align-items: start; margin-top: 24px; }
.tutorial-sidebar { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 7px;
  padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-panel); }
.tutorial-sidebar-title { padding: 3px 7px 8px; color: var(--fg-faint); font-size: 10.5px;
  font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.tutorial-platform-btn { width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 9px; border: 1px solid transparent; border-radius: 7px;
  color: var(--fg-dim); background: transparent; font: inherit; cursor: pointer; text-align: left; }
.tutorial-platform-btn:hover { color: var(--fg); background: var(--bg-raise); }
.tutorial-platform-btn.active { color: var(--fg); border-color: var(--line);
  background: var(--bg-raise); box-shadow: inset 3px 0 0 var(--platform-color); }
.tutorial-platform-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; }
.tutorial-count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 5px; align-items: center;
  justify-content: center; border: 1px solid var(--line); border-radius: 10px;
  color: var(--fg-faint); font-size: 10.5px; }
.tutorial-platform-content { min-width: 0; }
.tutorial-platform-head { display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin: 0 0 12px; padding: 0 2px 12px; border-bottom: 1px solid var(--line); }
.tutorial-platform-head h2 { margin: 2px 0 0; color: var(--fg); font-size: 19px; }
.tutorial-platform-head > span { color: var(--fg-faint); font-size: 11.5px; }
.tutorial-platform-kicker { color: var(--fg-faint); font-size: 10px; letter-spacing: .1em; }
.tutorial-card { border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 8px; background: var(--bg-panel); margin: 14px 0; overflow: hidden; }
.tutorial-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 17px 18px; cursor: pointer; list-style: none; }
.tutorial-card-head::-webkit-details-marker { display: none; }
.tutorial-card-head:hover { background: rgba(255,255,255,.018); }
.tutorial-card[open] .tutorial-card-head { border-bottom: 1px solid var(--line-soft); }
.tutorial-expand { flex: 0 0 auto; color: var(--fg-faint); font-size: 18px; line-height: 1;
  transform: rotate(-90deg); transition: transform .16s ease; }
.tutorial-card[open] .tutorial-expand { transform: rotate(0); }
.tutorial-card-body { padding: 2px 20px 20px; }
.tutorial-card h3 { margin: 0 0 5px; color: var(--fg); font-size: 16px; line-height: 1.45; }
.tutorial-card h4 { margin: 22px 0 9px; color: var(--fg); font-size: 13.5px; }
.tutorial-card h4 span { color: var(--fg-faint); font-size: 11px; font-weight: 400; }
.tutorial-card h5 { margin: 0 0 9px; color: var(--fg); font-size: 13px; }
.tutorial-card p { margin: 10px 0; }
.tutorial-meta { color: var(--fg-faint); font-size: 11.5px; }
.tutorial-audience { margin-top: 13px; color: var(--fg-dim); font-size: 12.5px; }
.tutorial-audience b { color: var(--fg); }
.tutorial-summary { color: var(--fg-dim); font-size: 13.5px; line-height: 1.85; }
.tutorial-actions, .tutorial-uniques { display: grid; gap: 10px; }
.tutorial-action, .tutorial-unique { padding: 14px 15px; border: 1px solid var(--line-soft);
  border-radius: 7px; background: rgba(255,255,255,.012); }
.tutorial-action ol, .tutorial-unique ol { margin: 0; padding-left: 20px; }
.tutorial-action li, .tutorial-unique li { margin: 0 0 7px; color: var(--fg-dim);
  font-size: 13px; line-height: 1.75; }
.tutorial-action li:last-child, .tutorial-unique li:last-child { margin-bottom: 0; }
.tutorial-unique { border-color: rgba(122,162,216,.28); background: rgba(122,162,216,.045); }
.tutorial-unique > p { color: var(--fg-dim); font-size: 12.5px; line-height: 1.75; }
.tutorial-unique > p b { color: var(--fg); }
.tutorial-done { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line);
  color: var(--fg-dim); font-size: 12.5px; line-height: 1.7; }
.tutorial-done b { display: inline-block; margin-right: 8px; color: var(--accent); font-size: 11.5px; }
.tutorial-link { display: inline-block; color: var(--accent); font-size: 12.5px; text-decoration: none; }
.tutorial-link:hover { text-decoration: underline; }
.tutorial-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 7px;
  color: var(--fg-faint); font-size: 12.5px; }

/* 窄屏 */
@media (max-width: 1100px) {
  #controls { position: absolute; left: 0; top: 0; bottom: 0; z-index: 20; }
  #detail { position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; width: 340px; flex-basis: 340px; }
}
@media (max-width: 720px) {
  #dd-article { padding: 28px 18px 100px; }
  .dd-h1 { font-size: 26px; }
  .dd-table { font-size: 12px; }
  .dd-table th, .dd-table td { padding: 7px 6px; overflow-wrap: anywhere; }
  .dd-table code { font-size: 11px; }
  .tutorial-layout { grid-template-columns: 1fr; gap: 18px; }
  .tutorial-sidebar { position: static; flex-direction: row; overflow-x: auto; padding: 8px; }
  .tutorial-sidebar-title { display: none; }
  .tutorial-platform-btn { flex: 0 0 auto; width: auto; }
  .tutorial-platform-btn.active { box-shadow: inset 0 -3px 0 var(--platform-color); }
  .tutorial-platform-head { align-items: flex-start; }
  .tutorial-card-body { padding: 2px 14px 16px; }
  .dd-learning-complete { align-items: stretch; flex-direction: column; gap: 14px; padding: 16px; }
  .dd-learning-actions { width: 100%; }
  .dd-learning-actions > button { flex: 1 1 0; min-width: 0; }
  .dd-path-btn { max-width: none; }
  .settings-overlay { align-items: end; padding: 10px; }
  .settings-dialog { width: 100%; border-radius: 12px 12px 8px 8px; }
  .settings-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .settings-select { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  #controls, .controls-toggle, .controls-toggle svg { transition: none; }
}
.dd-language-notice {
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 1px solid #607ca5;
  border-radius: 8px;
  color: #c6d7ef;
  background: #202c3a;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
/* English reading resources: scope by actual content language, including fallback. */
#dd-article[lang="en"] .dd-diagram-scroll { overflow-x: auto; max-width: 100%; }
#dd-article[lang="en"] .dd-diagram-scroll svg { display: block; width: 100%; min-width: 560px; max-width: none; }
#dd-article .dd-split-with-legend text:nth-of-type(n+4) { display: none; }
#dd-article .dd-split-legend { margin: .75rem 0; font-size: 16px; line-height: 1.6; text-align: left; }
#dd-article .dd-split-legend > div { display: grid; grid-template-columns: 10rem 1fr; gap: .5rem 1rem; padding: .5rem 0; }
#dd-article .dd-split-legend dt { font-weight: 600; }
#dd-article .dd-split-legend dd { margin: 0; color: var(--fg-dim); }
#dd-article .dd-diagram-hint { display: none; }
#dd-article[lang="en"] .dd-table-wrap { max-width: 100%; }
#dd-article[lang="en"] .dd-table { min-width: 620px; }
#dd-article[lang="en"] .dd-table th, #dd-article[lang="en"] .dd-table td { overflow-wrap: normal; word-break: normal; }
#dd-article[lang="en"] .dd-sec > .dd-table { display: block; min-width: 0; overflow-x: auto; }
#dd-article[lang="en"] .dd-sec > .dd-table th, #dd-article[lang="en"] .dd-sec > .dd-table td { min-width: 9rem; }
@media (max-width: 600px) {
  #dd-article .dd-split-legend > div { grid-template-columns: 1fr; }
  #dd-article .dd-diagram-hint { display: block; font-size: 14px; line-height: 1.6; color: var(--fg-faint); }
  #dd-article[lang="en"] .dd-table-wrap::before { content: "Scroll horizontally to read all columns."; display: block; font-size: 14px; color: var(--fg-faint); }
}
/* Reader feedback belongs to the reading interface, outside controlled article content. */
.dd-feedback { margin: 28px 0; padding: 16px; border: 1px solid currentColor; border-radius: 8px; }
.dd-feedback p { margin: 8px 0 0; font-size: .9em; }

/* ───────── Knowledge Atlas visual system ───────── */
::selection { background: #7aa2d838; color: #eef5ff; }
* { scrollbar-width: thin; scrollbar-color: #3b505f transparent; }
#topbar { background: linear-gradient(115deg,#16242c,#0e171f 70%); border-bottom: 1px solid #9bb8c329; box-shadow: 0 6px 30px #0003; height: 64px; flex-basis: 64px; padding-inline: 22px; gap: 18px; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #7aa2d838; border-radius: 8px; color: var(--accent); background: #8eafe00a; }
.brand-name { font-weight: 650; letter-spacing: .025em; }
.brand-ver { font-family: ui-monospace,Consolas,monospace; }
.mode-nav { padding: 4px; border-radius: 30px; background: #080e15a6; border-color: #7b9cad2c; }
.mode-nav-btn { border-radius: 24px; padding: 6px 12px; transition: color .18s,background .18s; }
.mode-nav-btn.active { color: #d1e2fc; background: #7aa2d818; box-shadow: inset 0 0 0 1px #7aa2d837; }
#search { border-radius: 24px; background: #09111999; border-color: #748fa342; min-height: 35px; padding-left: 15px; }
#search:focus { border-color: #a7cce6; box-shadow: 0 0 0 3px #a7cce613; }
#search-results { border-radius: 14px; box-shadow: 0 15px 40px #0008; }
.btn { border-radius: 7px; transition: border-color .18s,background .18s,color .18s; }
#btn-onboarding { border-color: #8cacdb52; color: #c4dafa; background: #7aa2d80a; }
#stage { background: radial-gradient(ellipse at 52% 44%,#1a303e80,transparent 62%), radial-gradient(#7397ac24 .65px,transparent .85px); background-size: auto,26px 26px; }
#controls { background: linear-gradient(160deg,#17242cf5,#0e171ff8); border-right-color: #8fb0c32e; box-shadow: 8px 0 35px #0002; }
.ctl-group { padding: 18px 16px; }
.ctl-group h3 { color: #bacdd5; font-size: 10px; letter-spacing: .16em; }
.ctl-hint { color: #93a7b4; line-height: 1.8; }
.seg { border-radius: 8px; overflow: hidden; }
.domain-group { padding-block: 3px; }
.learning-panel { background: linear-gradient(130deg,#7aa2d806,transparent); }
.learning-overview strong { color: var(--accent); font-family: ui-monospace,Consolas,monospace; }
.learning-progress { height: 4px; border-radius: 9px; }
.learning-progress > span { background: linear-gradient(90deg,#82b8d3,#7aa2d8); }
.official-path-toggle { border-radius: 8px; }
#detail { background: linear-gradient(155deg,#192831,#101b24); border-left-color: #93b4c53d; box-shadow: -12px 0 45px #0004; }
#detail-body { padding: 26px 24px 40px; }
#detail-body h2 { letter-spacing: -.025em; }
.dd-open { border-radius: 9px; padding-block: 12px; background: #8ac2d710; }
.controls-toggle, .detail-toggle { background: #16242df2; }
.settings-dialog, .progress-account-dialog { border-radius: 18px; border-color: #a6c7d044; background: linear-gradient(145deg,#1a2a34,#101a24); box-shadow: 0 30px 100px #0009; }
.settings-head { background: #8fc2ce05; }
#software-view, #library-view { padding: 36px 36px 64px; background: radial-gradient(ellipse at 80% 0,#2343424d,transparent 48%),var(--bg); }
.sw-head, .sw-cat { max-width: 1180px; margin-inline: auto; }
.sw-head, .lib-head { padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid #a4bfcc26; }
.sw-head h2, .lib-head h2 { font-size: clamp(25px,3vw,36px); font-weight: 600; letter-spacing: -.04em; margin-bottom: 10px; }
.sw-head p, .lib-head p { color: var(--fg-dim); font-size: 13px; line-height: 1.8; margin-bottom: 0; }
.sw-cat { margin-bottom: 34px; }
.sw-cat h3 { padding-bottom: 12px; font-size: 14px; }
.sw-grid, .lib-grid { gap: 16px; }
.sw-card { position: relative; padding: 22px 20px; border-radius: 12px; background: linear-gradient(145deg,#1b2a35,#131e28); min-height: 140px; transition: transform .2s,border-color .2s,box-shadow .2s; }
.sw-card:hover, .lib-card:hover { transform: translateY(-3px); border-color: #9cbdca; box-shadow: 0 12px 24px #0003; background: linear-gradient(145deg,#213541,#15232d); }
.sw-name { font-size: 17px; letter-spacing: -.02em; }
.sw-by { margin: 4px 0 12px; }
.sw-sum { font-size: 13px; line-height: 1.8; }
.lib-card { border-radius: 12px; padding: 20px; background: linear-gradient(145deg,#1b2934,#131e28); transition: transform .2s,border-color .2s,box-shadow .2s; }
.lib-title { font-size: 17px; line-height: 1.55; }
.lib-summary { font-size: 13px; line-height: 1.8; }
.lib-card-top { margin-bottom: 14px; }
.lib-card-foot { padding-top: 12px; }
.lib-sources, .lib-subnav { border-radius: 12px; background: #14212b; }
.lib-source { padding-block: 10px; border-radius: 7px; }
.lib-source.active { background: #a2c5d812; }
.lib-platform-profile { border-radius: 12px; background: linear-gradient(130deg,#22333d,#131e28); }
.lib-search { border-radius: 8px; padding: 10px 13px; background: #0e1922; }
.lib-count { border: 1px solid #9cbee930; padding: 6px 12px; border-radius: 25px; color: #bed2ec; background: #86a9d808; }
@media (max-width: 1100px) {
  #topbar { gap: 10px; padding-inline: 14px; }
  .brand-ver { display: none; }
  .mode-nav-btn { padding-inline: 9px; }
}
@media (max-width: 760px) {
  #topbar { min-height: 64px; height: auto; flex-basis: auto; flex-wrap: wrap; padding: 12px; gap: 10px; }
  #topbar .search-wrap { order: 4; flex-basis: 100%; max-width: none; }
  #topbar .topbar-actions { display: flex; gap: 6px; }
  #topbar .brand { white-space: nowrap; }
  #software-view, #library-view { padding: 24px 16px 50px; }
  .sw-grid, .lib-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .sw-head, .lib-head { margin-bottom: 20px; padding-bottom: 18px; }
  .lib-head { flex-wrap: wrap; align-items: start; gap: 12px; }
  .sw-card { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sw-card:hover, .lib-card:hover { transform: none; }
}

/* Framed sidebar groups: retain the original dock and navigation layout. */
@font-face {
  font-family: 'Atlas Display';
  src: url('./fonts/sidebar-headings.woff2') format('woff2');
  font-style: normal; font-weight: 400; font-display: swap;
}
#controls { padding-top: 10px; padding-bottom: 12px; }
#controls > .ctl-group {
  --frame-accent: #8aafe0;
  position: relative; margin: 0 8px 12px; padding: 14px 10px 12px;
  border: 1px solid #a2bfd329; border-radius: 10px;
  background: linear-gradient(145deg,#9bbfff09,transparent 65%),#0d1720a8;
  box-shadow: inset 0 1px 0 #d4e9ff08,0 4px 12px #00000016;
}
#controls > .ctl-group:nth-of-type(2) { --frame-accent: #80b9c4; }
#controls > .learning-panel { --frame-accent: #d0b780; }
#controls > .ctl-group:nth-of-type(4) { --frame-accent: #a6a8d8; }
#controls > .ctl-group::before {
  content: ''; position: absolute; top: -1px; left: 12px; right: 12px; height: 1px;
  background: linear-gradient(90deg,transparent,var(--frame-accent),transparent); opacity: .5; pointer-events: none;
}
#controls > .ctl-group > h3 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 1px 0 12px; border-bottom: 1px solid #b5cce51e;
  font-family: "Atlas Display", "Microsoft YaHei", sans-serif;
  font-size: 19px; font-weight: 400; line-height: 1.4;
  letter-spacing: .06em; color: #e0eafa;
}
#controls > .ctl-group > h3::before {
  content: none;
}
#controls .sidebar-heading-text {
  position: relative; isolation: isolate; padding: 1px 3px; line-height: 1.1;
  color: var(--bg);
  display: inline-block; transform: scaleX(1.28); transform-origin: left center;
  -webkit-text-stroke: .06px currentColor;
}
#controls .sidebar-heading-text::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--accent);
  border: 1px solid var(--accent); border-radius: 3px;
}
html[lang="en"] #controls .sidebar-heading-text {
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  line-height: 1.3; white-space: nowrap;
  transform: none; -webkit-text-stroke: 0;
}
#controls .ctl-toggle-heading button { min-width: 0; }
#controls .domain-group + .domain-group { border-top-color: #b5cce50d; }
#controls .domain-row { border-radius: 6px; transition: background .15s; }
#controls .domain-row:hover { background: #9fbeef0c; }
#controls .domain-filter { font-size: 12px; gap: 6px; }
#controls .domain-filter em { min-width: 22px; padding: 0 4px; border-radius: 5px; background: #adcfff0a; text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
#controls .domain-expand { width: 21px; flex-basis: 21px; }
#controls .seg { padding: 3px; gap: 3px; border: 1px solid #aac7e21c; background: #060e1659; }
#controls .seg button { border: 0; border-radius: 5px; background: transparent; }
#controls .seg button.on { color: #e2edff; background: #7aa2d82e; box-shadow: inset 0 0 0 1px #a0c5f73b; }
#controls .scope-status { margin: 9px 0; font-size: 10px; }
#controls .mini { border-radius: 5px; border-color: #a6c3dd24; background: #8fb1d008; }
#controls .learning-overview { margin-bottom: 11px; }
#controls .learning-overview strong { font-size: 24px; font-weight: 500; }
#controls .official-path-toggle { padding: 9px 7px; border-color: #d0b78045; }
#controls .official-path-toggle span { font-size: 11px; }
#controls .official-path-toggle em { font-size: 9px; }
#controls .learning-group { border-top-color: #b5cce512; }
#controls .learning-group summary { font-size: 11px; }
#controls .learning-node-list:empty { padding: 0; }
#controls .edge-actions { gap: 4px; margin-bottom: 10px; }
#controls #edge-list .chk { font-size: 12px; }
@media (prefers-reduced-motion: reduce) {
  #controls .domain-row { transition: none; }
}

/* Brand icon (assets/brand/icon.svg) replaces the former ◈ / ✳ glyphs in the top bar and the onboarding header. */
.brand-mark { align-self: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: url("brand/icon.svg") center / contain no-repeat; color: transparent; font-size: 0; overflow: hidden; flex: none; }
#topbar .brand { align-items: center; gap: 10px; }
.onboarding-brand .onboarding-brand-symbol { display: block; width: 52px; height: 52px; border-radius: 13px; background: url("brand/icon.svg") center / contain no-repeat; color: transparent; font-size: 0; overflow: hidden; flex: none; }
@media (max-width: 760px) {
  .brand-mark { width: 34px; height: 34px; border-radius: 8px; }
  .onboarding-brand .onboarding-brand-symbol { width: 44px; height: 44px; border-radius: 11px; }
}
/* Task-oriented tutorial curriculum */
.course-home { max-width: 1100px; margin: 0 auto; padding-bottom: 44px; }
.course-eyebrow { display: block; color: var(--accent); font-size: 11px; letter-spacing: .12em; margin-bottom: 10px; }
.course-section-title { font-size: 13px; color: var(--fg-dim); margin: 0 0 14px; font-weight: 500; }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.course-card { appearance: none; width: 100%; min-width: 0; display: flex; align-items: flex-start; gap: 16px; text-align: left; font: inherit; color: var(--fg); background: linear-gradient(145deg, var(--bg-raise), var(--bg-panel)); border: 1px solid var(--line); border-top: 2px solid var(--module-color); border-radius: 12px; padding: 22px; cursor: pointer; transition: border-color .15s, background .15s; }
.course-card:hover { border-color: var(--module-color); background: var(--bg-raise); }
.course-card:focus-visible, .course-inline-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.course-number { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--module-color); padding-top: 2px; }
.course-card-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.course-tag { display: block; color: var(--fg-dim); font-size: 11px; margin-bottom: 8px; }
.course-title { display: block; font-size: 19px; font-weight: 600; line-height: 1.5; margin-bottom: 10px; }
.course-summary { display: block; font-size: 13px; color: var(--fg-dim); line-height: 1.8; }
.course-status { color: var(--fg-faint); font-size: 11px; margin-top: 20px; }
.course-arrow { color: var(--module-color); }
.course-direction-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.course-direction { appearance: none; padding: 10px 16px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 13px; color: var(--fg-dim); background: var(--bg-panel); cursor: pointer; }
.course-direction:hover, .course-direction[aria-current="page"] { color: var(--fg); border-color: var(--module-color); background: var(--bg-raise); }
.course-direction:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.course-category-heading { margin: 0 0 24px; font-size: 23px; }
.course-chapter-card { min-height: 230px; }
.course-chapter-card .course-card-copy { align-self: stretch; }
.course-chapter-card .course-status { margin-top: auto; padding-top: 22px; }
.course-chapter-planned:disabled { cursor: default; opacity: 1; }
.course-chapter-planned:disabled:hover { border-color: var(--line); border-top-color: var(--module-color); background: linear-gradient(145deg, var(--bg-raise), var(--bg-panel)); }
.course-return { margin: 0 0 24px 10px; }
#dd-article:has(.course-agent-overview) { max-width: 1280px; }
@media (max-width: 600px) { .course-direction { padding: 9px 12px; font-size: 12px; } .course-chapter-card { min-height: 200px; } }
.course-foundation { align-items: center; border-top-width: 1px; border-left: 3px solid var(--module-color); padding: 24px 28px; }
.course-foundation .course-title { font-size: 25px; }
.course-foundation .course-status { margin-top: 12px; }
.course-connection { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 22px 0; color: var(--fg-dim); font-size: 12px; }
.course-connection > span { color: var(--accent); font-size: 23px; }
.course-prerequisite { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; color: var(--fg-dim); margin: 24px 0; }
.course-inline-link { appearance: none; background: none; border: 0; padding: 4px 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.course-inline-link:hover { text-decoration: underline; }
.course-empty { border: 1px dashed var(--line); border-radius: 12px; padding: 32px; margin: 28px 0; background: var(--bg-panel); }
.course-empty h2, .course-next h2 { margin: 0 0 12px; font-size: 19px; }
.course-empty p { color: var(--fg-dim); margin: 0; }
.course-next-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .course-grid, .course-next-links { grid-template-columns: minmax(0, 1fr); } .course-card { padding: 20px; } .course-foundation .course-title { font-size: 22px; } .course-empty { padding: 24px; } }

/* Prompt workflow: local lesson styles, independent of the conversation host. */
/* Workflow diagrams keep readable node sizes; overflow stays inside each figure. */
.course-diagram { min-width: 0; max-width: 100%; margin: 24px 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #111b28; color: #edf3fb; }
.course-diagram > figcaption { font-size: 14px; font-weight: 600; line-height: 1.7; margin-bottom: 12px; }
.course-diagram-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.course-diagram-controls button { appearance: none; border: 1px solid #607b98; border-radius: 5px; background: #202f41; color: #edf3fb; font: inherit; font-size: 12px; padding: 7px 10px; cursor: pointer; min-height: 36px; }
.course-diagram-controls button:hover { background: #304761; }
.course-diagram-controls button:focus-visible, .course-diagram-viewport:focus-visible, .course-diagram-source summary:focus-visible { outline: 2px solid #b3ddff; outline-offset: 3px; }
.course-diagram-controls button:disabled { opacity: .45; cursor: default; }
.course-diagram-scale { font-size: 12px; color: #becfe1; min-width: 4ch; }
.course-reading .course-diagram-hint { font-size: 12px; line-height: 1.6; color: #becfe1; margin: 10px 0; }
.course-diagram-viewport { max-width: 100%; max-height: min(80dvh, 900px); overflow: auto; padding: 12px; border: 1px solid #35475d; border-radius: 6px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.course-diagram-canvas { margin: 0 auto; }
.course-diagram-canvas > svg { display: block; }
.course-diagram-status { padding: 24px 0; font-size: 13px; color: #becfe1; }
.course-diagram-source { margin-top: 12px; font-size: 12px; }
.course-diagram-source summary { cursor: pointer; color: #becfe1; padding: 4px 0; }
@media (max-width: 600px) { .course-diagram { padding: 12px; } .course-diagram-controls { gap: 6px; } .course-diagram-controls button { min-height: 40px; } }
/* Tutorial reading layout; scoped so understanding pages retain their typography. */
#dd-article:has(.course-layout) { max-width: 1800px; padding: 32px 28px 100px; }
.course-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(320px, 390px); column-gap: 36px; row-gap: 40px; align-items: start; }
.course-layout > * { min-width: 0; }
.course-sidebar { grid-column: 1; grid-row: 1 / 4; position: sticky; top: 24px; max-height: calc(100dvh - 98px); overflow-y: auto; padding-right: 16px; border-right: 1px solid var(--line-soft); scrollbar-width: thin; }
.course-sidebar-label { color: var(--fg-faint); font-size: 11px; letter-spacing: .12em; margin: 0 0 16px 10px; }
.course-nav-link { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 5px; color: var(--fg); background: transparent; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.course-nav-child { color: var(--fg-dim); padding-left: 20px; font-size: 12px; }
.course-nav-link:hover, .course-nav-link:focus-visible { background: var(--bg-raise); color: var(--accent); }
.course-nav-link:focus-visible, .course-faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.course-main { grid-column: 2; grid-row: 1; }
.course-layout.course-agent-layout { grid-template-columns: 220px minmax(0, 820px); justify-content: center; }
.course-agent-layout .course-main > :is(.course-faq, .course-next) { margin-top: 40px; }
.course-agent-layout .course-sidebar { grid-row: 1; }
.course-agent-layout .course-reading { margin-bottom: 40px; overflow-wrap: anywhere; }
.course-agent-layout .d-table { display: block; max-width: 100%; overflow-x: auto; margin-bottom: 20px; }
.course-agent-layout .course-sidebar .course-nav-child { display: block; }
.course-agent-section-body h3 { margin: 32px 0 16px; font-size: 20px; }
.course-agent-section-body h4 { margin: 28px 0 12px; font-size: 17px; }
.course-agent-section-body h5, .course-agent-section-body h6 { margin: 24px 0 10px; font-size: 15px; line-height: 1.7; }
.course-agent-section-body :is(h3, h4, h5, h6)[id] { scroll-margin-top: 24px; }
.course-agent-section-body :is(ul, ol) { margin: 0 0 20px; padding-left: 1.6em; line-height: 1.9; }
.course-agent-section-body li + li { margin-top: 6px; }
.course-agent-section-body pre { max-width: 100%; margin: 16px 0 24px; padding: 18px 20px; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--bg-panel); white-space: pre-wrap; overflow-wrap: anywhere; }
#dd-article .course-agent-section-body pre code { padding: 0; border: 0; background: transparent; font: 13px/1.8 Consolas, monospace; white-space: inherit; }
.course-agent-section-body blockquote { margin: 16px 0 24px; padding: 12px 18px; border-left: 2px solid var(--accent); background: var(--bg-panel); }
.course-agent-section-body blockquote p:last-child { margin-bottom: 0; }
@media (min-width: 601px) {
  html[lang="en"] #course-agent-discovery > .course-agent-section:nth-of-type(n+2) .d-table :is(th, td):first-child { min-width: 140px; }
  html[lang="en"] #course-agent-discovery > .course-agent-section:nth-of-type(n+2) .d-table :is(th, td):nth-child(2) { min-width: 210px; }
}
@media (max-width: 600px) {
  #course-agent-discovery > .course-agent-section:nth-of-type(n+2) .d-table { display: block; width: 100%; }
  #course-agent-discovery > .course-agent-section:nth-of-type(n+2) .d-table thead { display: none; }
  #course-agent-discovery > .course-agent-section:nth-of-type(n+2) .d-table tbody { display: grid; gap: 12px; }
  #course-agent-discovery > .course-agent-section:nth-of-type(n+2) .d-table tr { display: block; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
  #course-agent-discovery > .course-agent-section:nth-of-type(n+2) .d-table td { display: block; border: 0; padding: 0; }
  #course-agent-discovery > .course-agent-section:nth-of-type(n+2) .d-table td:first-child { font-weight: 600; color: var(--fg); font-size: 14px; }
  #course-agent-discovery > .course-agent-section:nth-of-type(n+2) .d-table td + td { margin-top: 7px; }
}
.course-layout .course-faq { grid-column: 2; grid-row: 2; margin: 0; }
.course-layout .course-next { grid-column: 2; grid-row: 3; margin: 0; border-top: 1px solid var(--line); padding-top: 28px; }
.course-workflow-rail { grid-column: 3; grid-row: 1 / 4; position: sticky; top: 24px; max-height: calc(100dvh - 98px); overflow-y: auto; scrollbar-width: thin; scrollbar-gutter: stable; border-left: 1px solid var(--line); padding: 0 4px 0 24px; }
.course-workflow-rail .course-workflow-chapter { margin: 0; }
.course-workflow-rail .prompt-workflow { margin: 20px 0 12px; }
.course-workflow-rail .prompt-workflow .pw-layout { grid-template-columns: minmax(0, 1fr); }
.course-workflow-rail .dd-sec h2 { font-size: 19px; }
.course-faq, .course-faq-group { scroll-margin-top: 24px; }
.course-faq-count { margin-left: auto; color: var(--fg-faint); font-size: 12px; font-weight: 400; }
.course-faq .course-faq-hint { font-size: 13px; margin-top: 12px; }
.course-faq-group { margin-top: 32px; }
.course-faq-group h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.course-faq-group h3 > span { color: var(--accent); font-size: 13px; }
.course-faq-group h3 small { margin-left: auto; color: var(--fg-faint); font-size: 12px; font-weight: 400; }
.course-faq-item { border-bottom: 1px solid var(--line-soft); }
.course-faq-item:first-of-type { border-top: 1px solid var(--line-soft); }
.course-faq-item summary { display: grid; grid-template-columns: 45px minmax(0, 1fr) 18px; gap: 12px; align-items: baseline; padding: 17px 4px; cursor: pointer; list-style: none; font-size: 14px; line-height: 1.75; }
.course-faq-item summary::-webkit-details-marker { display: none; }
.course-faq-item summary:hover { color: var(--accent); }
.course-faq-id { color: var(--fg-faint); font: 11px/1.75 Consolas, monospace; }
.course-faq-toggle { color: var(--accent); transition: transform .15s; text-align: center; }
.course-faq-item[open] .course-faq-toggle { transform: rotate(45deg); }
.course-faq-item[open] summary { color: var(--accent); }
.course-faq-answer { padding: 4px 4px 16px 61px; color: var(--fg-dim); font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.course-faq-answer a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.course-faq-answer strong { color: var(--fg); font-weight: 600; }
.course-faq-answer .quote { border-left: 2px solid var(--accent); padding: 12px 16px; background: var(--bg-panel); border-radius: 0 6px 6px 0; }
.course-faq-answer .d-table { display: block; width: 100%; overflow-x: auto; font-size: 12px; }
@media (min-width: 1650px) { .course-layout { grid-template-columns: 200px minmax(0, 1fr) 420px; column-gap: 48px; } }
@media (max-width: 1199px) {
  #dd-article:has(.course-layout) { padding: 24px 20px 80px; }
  .course-layout { grid-template-columns: 150px minmax(0, 1fr); column-gap: 28px; }
  .course-sidebar { grid-row: 1 / 5; }
  .course-workflow-rail { grid-column: 2; grid-row: 2; position: static; max-height: none; overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
  .course-layout .course-faq { grid-row: 3; }
  .course-layout .course-next { grid-row: 4; }
}
@media (max-width: 700px) {
  #dd-article:has(.course-layout) { padding: 20px 18px 80px; }
  .course-layout { display: flex; flex-direction: column; gap: 32px; }
  .course-layout > * { width: 100%; }
  .course-sidebar { position: static; max-height: none; overflow: visible; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px; }
  .course-sidebar-label { width: 100%; margin: 0 8px 6px; }
  .course-nav-link { width: auto; padding: 6px 8px; font-size: 12px; }
  .course-sidebar .course-nav-child { display: none; }
  .course-sidebar [data-course-section="course-examples"] { display: block; }
  .course-layout .dd-h1 { font-size: 26px; }
  .course-faq-item summary { grid-template-columns: 38px minmax(0, 1fr) 16px; gap: 8px; }
  .course-faq-answer { padding-left: 4px; }
}

.course-examples { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.course-examples h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.course-examples .pe-hint, .course-examples .pe-rating-note { color: var(--fg-dim); font-size: 12px; line-height: 1.8; margin: 10px 0 16px; }
.pe-filters, .pe-languages, .pe-toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.pe-toolbar { justify-content: space-between; align-items: center; margin: 14px 0 10px; }
.course-examples button { appearance: none; font: inherit; font-size: 12px; line-height: 1.4; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--fg-dim); background: var(--bg-panel); cursor: pointer; }
.course-examples button:hover { border-color: var(--accent); color: var(--fg); }
.course-examples button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--bg-raise); }
.course-examples button:focus-visible, .course-examples summary:focus-visible, .pe-code:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pe-item { border-bottom: 1px solid var(--line-soft); }
.pe-item:first-child { border-top: 1px solid var(--line-soft); }
.pe-item > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: baseline; gap: 8px; padding: 15px 2px; font-size: 13px; line-height: 1.7; cursor: pointer; list-style: none; }
.pe-item > summary::-webkit-details-marker { display: none; }
.pe-title { overflow-wrap: anywhere; }
.pe-badge { color: var(--fg-dim); font-size: 10px; white-space: nowrap; }
.pe-chevron { color: var(--accent); text-align: center; }
.pe-item[open] > summary { color: var(--accent); }
.pe-item[open] .pe-chevron { transform: rotate(45deg); }
.pe-body { padding: 0 2px 18px; min-width: 0; }
.course-examples .pe-source { margin: 0 0 10px; color: var(--fg-faint); font-size: 11px; }
.pe-context { font-size: 12px; line-height: 1.8; color: var(--fg-dim); overflow-wrap: anywhere; }
.pe-context p { margin: 8px 0; }
.pe-code, .pe-license-body pre { box-sizing: border-box; display: block; width: 100%; max-width: 100%; max-height: 32rem; overflow: auto; padding: 14px; margin: 0; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--bg-panel); color: var(--fg); font: 12px/1.85 var(--font-sans, system-ui, sans-serif); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; scrollbar-width: thin; }
.pe-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; font-size: 11px; }
.course-examples a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.pe-status { display: block; font-size: 11px; color: var(--fg-dim); line-height: 1.6; }
.pe-status:not(:empty) { margin-top: 8px; }
.pe-licenses { margin-top: 20px; font-size: 12px; color: var(--fg-dim); line-height: 1.8; }
.pe-licenses > summary { cursor: pointer; padding: 8px 0; }
.pe-license-body { overflow-wrap: anywhere; }
.pe-license-body h3 { margin: 20px 0 8px; font-size: 13px; }
.prompt-workflow { margin: 36px 0 44px; color: var(--fg); font-size: 14px; line-height: 1.7; }
.prompt-workflow .pw-heading h3 { margin: 0; font-size: 19px; line-height: 1.4; }
.prompt-workflow h3 { margin: 0 0 12px; font-size: 17px; line-height: 1.5; }
.prompt-workflow h4 { margin: 0; font-size: 15px; }
.prompt-workflow p { margin: 8px 0; }
.prompt-workflow .pw-muted { color: var(--fg-dim); font-size: 13px; }
.prompt-workflow .pw-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; align-items: start; margin-top: 28px; }
.prompt-workflow .pw-layout > * { min-width: 0; }
.prompt-workflow .pw-button { appearance: none; font: inherit; font-size: 13px; line-height: 1.5; color: var(--fg-dim); background: var(--bg-panel); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; min-height: 44px; max-width: 100%; cursor: pointer; overflow-wrap: anywhere; }
.prompt-workflow .pw-button:hover { color: var(--fg); border-color: var(--accent); }
.prompt-workflow .pw-button[aria-pressed="true"] { color: var(--fg); border-color: var(--accent); background: var(--bg-raise); box-shadow: inset 3px 0 var(--accent); }
.prompt-workflow .pw-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.prompt-workflow .pw-flow { position: relative; padding: 16px 0 0 70px; }
.prompt-workflow .pw-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: var(--fg-faint); overflow: visible; }
.prompt-workflow .pw-stage { position: relative; margin-bottom: 48px; }
.prompt-workflow .pw-stage:last-of-type { margin-bottom: 0; }
.prompt-workflow #pw-stage-4 { margin-bottom: 0; }
.prompt-workflow .pw-stage-button { width: 100%; color: var(--fg); font-weight: 600; }
.prompt-workflow .pw-stage-hint { margin-top: 8px; text-align: center; font-size: 12px; color: var(--fg-dim); }
.prompt-workflow .pw-bypass { position: absolute; left: 0; width: 57px; padding: 5px 2px; background: var(--bg); font-size: 12px; line-height: 1.6; text-align: center; overflow-wrap: anywhere; }
.prompt-workflow .pw-caption { text-align: center; margin-top: 18px; }
.prompt-workflow .pw-categories { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.prompt-workflow .pw-modules { display: grid; gap: 8px; margin: 16px 0; }
.prompt-workflow .pw-modules .pw-button { width: 100%; text-align: left; }
.prompt-workflow .pw-detail { border-left: 2px solid var(--accent); padding: 16px 18px; background: var(--bg-panel); border-radius: 0 8px 8px 0; overflow-wrap: anywhere; }
.prompt-workflow dl { margin: 0; }
.prompt-workflow dt { color: var(--fg-dim); font-size: 12px; margin: 14px 0 4px; }
.prompt-workflow dd { margin: 0; }
.prompt-workflow .pw-prompt { color: var(--fg); }
.prompt-workflow .pw-feedback { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 22px; }
.prompt-workflow .pw-feedback-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
@media (max-width: 700px) {
  .prompt-workflow .pw-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .prompt-workflow .pw-flow { max-width: 380px; margin: 0 auto; }
  .prompt-workflow .pw-heading h2 { font-size: 22px; }
}

/* Keep the fifth chapter's long step list compact on phones. */
@media (max-width: 600px) {
  .course-agent-layout:has(#course-agent-evaluation) .course-sidebar { display: block; max-height: 240px; overflow-y: auto; }
}

@media (max-width: 600px) {
  #course-agent-evaluation-topic-1 .d-table thead { display: none; }
  #course-agent-evaluation-topic-1 .d-table tbody { display: grid; gap: 12px; }
  #course-agent-evaluation-topic-1 .d-table tr { display: block; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
  #course-agent-evaluation-topic-1 .d-table td { display: block; border: 0; padding: 0; }
  #course-agent-evaluation-topic-1 .d-table td:first-child { font-weight: 600; font-size: 14px; }
  #course-agent-evaluation-topic-1 .d-table td + td { margin-top: 7px; }
}
