:root {
  --bg: #f4f6f7;
  --ink: #171e21;
  --muted: #5a6368;
  --surface: #ffffff;
  --line: #d8dddf;
  --accent: #0379b3;
  --accent-strong: #025f8d;
  --gold: #c58b2b;
  --blue: #456c91;
  --shadow: 0 18px 50px rgba(31, 53, 45, 0.12);
  --radius: 8px;
  --fixed-footer-height: 42px;
  --fixed-widget-gap: 18px;
}

.docs-topbar .course-homework-link {
  margin-left: auto;
  flex-shrink: 0;
  border: 1px solid #0379b3;
  border-radius: 6px;
  padding: 7px 14px;
  color: #025f8d;
  background: #f0f5f8;
  font-size: 14px;
  font-weight: 600;
}
.docs-topbar .course-homework-link:hover { background: #e0ebf1; }
.docs-topbar .course-homework-link + .course-homework-link { margin-left: 8px; }
/* “讨论本节”：放在小节标题后面、同一行，小号圆角按钮，不影响标题文字 */
.section-discuss-link { display: inline-block; margin-left: 16px; vertical-align: middle; position: relative; top: -2px; font-size: 13px; font-weight: 400; line-height: 1.6; letter-spacing: 0; color: #025f8d; border: 1px solid #b8d1dd; border-radius: 999px; padding: 1px 12px; background: #f6f9fb; text-decoration: none; white-space: nowrap; }
.section-discuss-link:hover { background: #e0ebf1; }
@media print { .section-discuss-link { display: none; } }
@media (max-width: 640px) {
  .docs-topbar .course-homework-link { padding: 5px 8px; font-size: 12px; }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.65;
}

body.docs-body {
  background: #ffffff;
  overflow-x: hidden;
}

body.docs-body.footer-fixed {
  padding-bottom: var(--fixed-footer-height);
}

a {
  color: inherit;
  text-decoration: none;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid #d8dddf;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  transition: background 300ms ease, border-color 300ms ease;
}

.docs-topbar.is-on-cover {
  background: rgba(255, 255, 255, 0);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.docs-topbar.is-on-cover .docs-brand {
  color: #fff;
}

.docs-topbar.is-on-cover .docs-brand small {
  color: rgba(255, 255, 255, 0.65);
}

.docs-topbar.is-on-cover .docs-actions {
  color: rgba(255, 255, 255, 0.78);
}

.docs-topbar.is-on-cover .docs-actions a:hover,
.docs-topbar.is-on-cover .docs-actions a.is-current {
  color: #fff;
}

.docs-topbar.is-on-cover .brand-mark {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.topbar-logo {
  height: 36px;
  width: auto;
  display: block;
}

.docs-topbar.is-on-cover .topbar-logo {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.docs-brand strong,
.docs-brand small {
  display: block;
  line-height: 1.15;
}

.docs-brand small {
  color: var(--muted);
  font-size: 12px;
}

.docs-actions {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.docs-actions a:hover {
  color: var(--accent-strong);
}

.docs-actions a.is-current {
  color: var(--accent-strong);
}

/* ---- Cover Hero ---- */

.cover-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 58px);
  padding: clamp(40px, 8vw, 96px) clamp(20px, 6vw, 72px);
  background-color: #171e21;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

.cover-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    linear-gradient(175deg, rgba(9, 18, 15, 0.78) 0%, rgba(14, 34, 27, 0.65) 40%, rgba(23, 33, 29, 0.72) 100%);
  z-index: 1;
}

.cover-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  text-align: center;
  animation: coverFadeIn 0.9s ease;
}

@-webkit-keyframes coverFadeIn {
  from { opacity: 0; -webkit-transform: translateY(24px); transform: translateY(24px); }
  to   { opacity: 1; -webkit-transform: translateY(0);    transform: translateY(0); }
}
@keyframes coverFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cover-badge {
  display: inline-block;
  margin: 0 0 22px;
  padding: 5px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cover-title {
  margin: 0 0 28px;
  color: #fff;
  line-height: 1.12;
}

.cover-title-main {
  display: block;
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.cover-title-sub {
  display: block;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 300;
  letter-spacing: 0.04em;
}

.cover-lead {
  max-width: 640px;
  margin: 0 auto 40px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 17px;
  line-height: 1.8;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 56px;
}

.cover-btn {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.cover-btn:hover {
  transform: translateY(-2px);
}

.cover-btn--primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 28px rgba(31, 122, 104, 0.4);
}

.cover-btn--primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 12px 36px rgba(31, 122, 104, 0.55);
}

.cover-btn--ghost {
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
}

.cover-btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.16);
}

.cover-scroll {
  display: grid;
  place-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  animation: coverScrollPulse 2.4s ease-in-out infinite;
}

.cover-scroll::before {
  content: "向下滚动探索";
  font-weight: 600;
  letter-spacing: 0.06em;
}

.cover-scroll span {
  display: block;
  width: 22px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 11px;
  position: relative;
}

.cover-scroll span::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  animation: coverScrollDot 1.6s ease-in-out infinite;
}

@-webkit-keyframes coverScrollPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}
@keyframes coverScrollPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

@-webkit-keyframes coverScrollDot {
  0%, 100% { top: 7px; opacity: 0.7; }
  50% { top: 17px; opacity: 0.15; }
}
@keyframes coverScrollDot {
  0%, 100% { top: 7px; opacity: 0.7; }
  50% { top: 17px; opacity: 0.15; }
}

@media (max-width: 760px) {
  .cover-hero {
    min-height: calc(100vh - 58px);
    padding: 48px 5vw;
  }

  .cover-title-main {
    font-size: clamp(36px, 11vw, 56px);
  }

  .cover-title-sub {
    font-size: 18px;
  }

  .cover-lead {
    font-size: 15px;
    line-height: 1.7;
  }

  .cover-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: 36px;
  }

  .cover-btn {
    width: 100%;
    max-width: 280px;
  }
}

/* ---- Docs Shell ---- */

.docs-shell {
  display: grid;
  grid-template-columns: clamp(236px, 22vw, 286px) minmax(0, 1fr);
}

.docs-sidebar {
  position: sticky;
  top: 58px;
  align-self: start;
  height: calc(100vh - 58px);
  overflow-y: auto;
  border-right: 1px solid #d8dddf;
  background: #f7f8f9;
  padding: 22px 18px 34px;
}

.sidebar-section + .sidebar-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #d8dddf;
}

.sidebar-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.sidebar-chapter {
  margin: 0;
}

.sidebar-chapter + .sidebar-chapter {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d8dddf;
}

.sidebar-chapter summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.sidebar-chapter summary::-webkit-details-marker {
  display: none;
}

.sidebar-chapter summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #778084;
  border-bottom: 2px solid #778084;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.sidebar-chapter[open] summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.sidebar-chapter summary:hover {
  background: #edf1f3;
}

.docs-sidebar a {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  color: #565f63;
  font-size: 16px;
  line-height: 1.35;
}

.docs-sidebar a:hover,
.docs-sidebar a.is-active {
  color: var(--accent-strong);
  background: #e8eff2;
}

.docs-content {
  min-width: 0;
}

.doc-article {
  width: min(100%, 1040px);
  padding: clamp(30px, 4vw, 54px) clamp(20px, 5vw, 56px) 96px;
}

.doc-section {
  scroll-margin-top: 82px;
  padding: 40px 0;
  border-bottom: 1px solid #e5e9eb;
}

.doc-hero {
  padding-top: 0;
}

.chapter-label {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.doc-article h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.doc-article h2 {
  margin: 0 0 18px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.doc-article .chapter-section-title {
  margin: 0 0 14px;
  font-size: 32px;
  line-height: 1.22;
  letter-spacing: 0;
}

.doc-article h3 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
}

.doc-article p {
  margin: 0 0 16px;
  color: #394246;
  font-size: 18px;
  line-height: 1.75;
}

.doc-article .lead {
  max-width: 820px;
  margin-top: 18px;
  color: #4c555a;
  font-size: 19px;
}

.doc-summary,
.callout-grid,
.chapter-grid,
.concept-flow,
.deformation-compare,
.object-labels,
.timeline,
.method-cards,
.application-grid {
  display: grid;
  gap: 14px;
}

.doc-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.doc-summary div,
.doc-callout,
.formula-note,
.doc-quote,
.assumption-list article {
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.doc-summary div {
  padding: 18px;
}

.doc-summary span,
.doc-summary strong {
  display: block;
}

.doc-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.doc-summary strong {
  margin-top: 8px;
  color: var(--accent-strong);
  font-size: 18px;
  line-height: 1.35;
}

.definition-quote {
  margin: 24px 0 0;
  padding: 20px 22px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f4f8fa;
}

.definition-quote p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.7;
}

.definition-quote cite {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
}

.timeline {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 20px 0;
}

.timeline article,
.timeline-card,
.definition-card,
.method-cards article {
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
  padding: 16px;
}

.timeline span,
.timeline-card span,
.method-cards span {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.timeline p,
.timeline-card p,
.method-cards p,
.definition-card p {
  margin-bottom: 0;
}

.timeline-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.timeline-card:hover,
.timeline-card:focus-visible,
.timeline-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(31, 122, 104, 0.55);
  background: #eef4f7;
  outline: none;
}

.timeline-detail {
  margin: 18px 0 24px;
  padding: 18px;
  border: 1px solid rgba(31, 122, 104, 0.25);
  border-radius: 8px;
  background: #ffffff;
}

.timeline-people {
  display: grid;
  gap: 14px;
}

.timeline-people article {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e5e9eb;
  border-radius: 8px;
  background: #fbfcfc;
}

.timeline-people img {
  display: block;
  width: 100%;
  height: 132px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.timeline-people strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 22px;
}

.timeline-people p {
  margin-bottom: 0;
}

.definition-card {
  margin: 24px 0;
  border-left: 4px solid var(--accent);
}

.compact-hero {
  padding-top: 6px;
}

.compact-hero .definition-quote {
  margin-top: 0;
}

.scientist-panel {
  display: grid;
  grid-template-columns: 180px 180px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin: 22px 0;
}

.scientist-card,
.task-layout figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.scientist-card img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: #fff;
}

.scientist-card figcaption,
.task-layout figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.qian-note {
  padding: 18px 20px;
  border: 1px solid #d8dddf;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fffaf0;
}

.qian-note p {
  margin-bottom: 0;
}

.definition-card-large h3 {
  color: var(--accent-strong);
  font-size: 26px;
  line-height: 1.25;
}

.definition-card-large p {
  font-size: 18px;
  line-height: 1.75;
}

.relation-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
  padding: 22px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31, 122, 104, 0.06), rgba(197, 139, 43, 0.06)),
    #f9fafb;
}

.relation-center {
  grid-column: span 4;
  display: grid;
  min-height: 84px;
  place-items: center;
  border: 1px solid rgba(31, 122, 104, 0.28);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.relation-center strong {
  color: var(--accent-strong);
  font-size: 24px;
}

.relation-center span {
  color: var(--muted);
  font-size: 14px;
}

.relation-node {
  min-height: 88px;
  padding: 14px 10px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.relation-node span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.relation-node:hover,
.relation-node:focus-visible,
.relation-node.is-selected {
  transform: translateY(-2px);
  border-color: rgba(31, 122, 104, 0.55);
  background: #e8eff2;
  outline: none;
}

.relation-detail {
  grid-column: span 4;
  min-height: 96px;
  padding: 18px 20px;
  border: 1px solid rgba(31, 122, 104, 0.24);
  border-radius: 8px;
  background: #ffffff;
}

.relation-detail strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 18px;
}

.relation-detail p {
  margin-bottom: 0;
}

.subject-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.subject-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  color: var(--ink);
  background: #f9fafb;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.subject-card span,
.subject-card strong {
  display: block;
}

.subject-card span {
  color: var(--gold);
  font-size: 14px;
  font-weight: 900;
}

.subject-card strong {
  margin-top: 10px;
  color: var(--accent-strong);
  font-size: 24px;
  line-height: 1.25;
}

.subject-card:hover,
.subject-card:focus-visible,
.subject-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(31, 122, 104, 0.55);
  background: #eef4f7;
  outline: none;
}

.subject-detail {
  grid-column: span 3;
  padding: 20px 22px;
  border: 1px solid rgba(31, 122, 104, 0.25);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
}

.subject-detail strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 20px;
}

.subject-detail p {
  margin-bottom: 0;
}

.relation-perspective {
  margin-top: 24px;
}

.relation-perspective h4 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
}

.method-brief {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(min(100%, 280px), 0.95fr);
  gap: 18px;
  margin: 22px 0;
}

.method-main,
.method-side article {
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.method-main {
  padding: 24px;
  border-left: 4px solid var(--accent);
}

.method-main span,
.method-side span {
  display: block;
  color: var(--gold);
  font-size: 14px;
  font-weight: 900;
}

.method-main strong {
  display: block;
  margin: 10px 0 12px;
  color: var(--accent-strong);
  font-size: 28px;
  line-height: 1.28;
}

.method-main p,
.method-side p {
  margin-bottom: 0;
}

.method-side {
  display: grid;
  gap: 10px;
}

.method-side article {
  padding: 16px 18px;
}

.method-flow-diagram {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 28px minmax(120px, 1fr) 28px minmax(120px, 1fr) 28px minmax(120px, 1fr) 28px minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.method-flow-diagram div {
  display: grid;
  min-height: 76px;
  place-items: center;
  padding: 12px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  color: var(--accent-strong);
  background: #f9fafb;
  font-weight: 900;
  text-align: center;
}

.method-flow-diagram span {
  position: relative;
  height: 2px;
  background: var(--accent);
}

.method-flow-diagram span::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -1px;
  border-left: 9px solid var(--accent);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.task-layout img {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: cover;
  background: #fff;
}

.task-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.task-list span {
  color: var(--gold);
  font-weight: 900;
}

.task-list p {
  margin-bottom: 0;
}

.task-list-full {
  margin-top: 18px;
}

.task-list-full li {
  grid-template-columns: 110px minmax(0, 1fr);
}

.callout-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.doc-callout {
  padding: 18px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  font-size: 15px;
}

.doc-table th,
.doc-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #d8dddf;
  text-align: left;
  vertical-align: top;
}

.doc-table th {
  background: #eef2f4;
  color: var(--accent-strong);
  font-weight: 900;
}

.doc-table tr:last-child td {
  border-bottom: 0;
}

.doc-figure {
  margin: 24px 0;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
  overflow: hidden;
}

.figure-small {
  max-width: 420px;
}

.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.doc-figure figcaption {
  padding: 12px 16px;
  border-top: 1px solid #d8dddf;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ---- 1.2 研究对象演示：卡片 + 视频舞台 ---- */
.object-media-figure {
  margin: 24px 0;
}

.object-media-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.object-media-card {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.object-media-card:hover,
.object-media-card:focus-visible,
.object-media-card.is-selected {
  transform: translateY(-2px);
  border-color: var(--swjtu-blue, #0379b3);
  background: #eaf4fa;
  outline: none;
}

.object-media-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.doc-article .object-media-card p {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.7;
}

.object-media-stage {
  /* 素材均为 1280×960（4:3），舞台宽度限制为 720px 后正好 720×540，
     画面可以铺满容器，不会出现左右黑边。 */
  max-width: 720px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.object-media-panel {
  display: none;
}

.object-media-panel.is-active {
  display: block;
}

.object-media-panel[hidden],
.object-media-status[hidden] {
  display: none;
}

.object-media-status {
  padding: 12px 16px;
  margin: 0;
}

.object-media-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  object-fit: contain;
}

.object-media-figure figcaption {
  margin-top: 10px;
}

@media (max-width: 760px) {
  .object-media-tabs {
    grid-template-columns: 1fr;
  }

  .object-media-card {
    padding: 12px 14px;
  }
}

.concept-flow {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 18px;
}

.concept-flow div,
.deformation-compare article {
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
  padding: 16px;
}

.concept-flow span,
.concept-flow strong {
  display: block;
}

.concept-flow span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.concept-flow strong {
  margin-top: 6px;
  color: var(--accent-strong);
  line-height: 1.35;
}

.deformation-compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.object-labels {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: -10px 0 20px;
}

.object-labels span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  color: var(--accent-strong);
  background: #eef2f4;
  font-size: 14px;
  font-weight: 800;
}

.formula-note {
  margin-top: 18px;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
}

.formula-note p:last-child {
  margin-bottom: 0;
}

/* ---- Chapter 2: Stress Theory ---- */

.chapter-page .docs-topbar {
  background: rgba(255, 255, 255, 0.98);
}

.stress-article {
  max-width: 1120px;
}

.chapter-route,
.learning-goals,
.tensor-ladder,
.notation-grid,
.concept-grid,
.compare-row,
.boundary-tabs,
.formula-map,
.quiz-list {
  display: grid;
  gap: 14px;
}

.chapter-route {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  margin-top: 28px;
  padding: 16px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.route-node {
  min-height: 58px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #fff;
  color: #333c41;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.route-node:hover,
.route-node:focus-visible,
.route-node.is-selected {
  border-color: rgba(31, 122, 104, 0.55);
  background: #e8eff2;
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.route-detail {
  grid-column: 1 / -1;
  min-height: 82px;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
}

.route-detail strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 18px;
}

.route-detail p {
  margin-bottom: 0;
}

.learning-goals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.learning-goals article,
.tensor-ladder article,
.notation-grid article,
.concept-grid article,
.compare-row article,
.boundary-tabs article,
.formula-map article,
.quiz-list article {
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.learning-goals span,
.tensor-ladder span,
.concept-grid span,
.boundary-tabs span,
.formula-map span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.learning-goals p,
.tensor-ladder p,
.notation-grid p,
.concept-grid p,
.compare-row p,
.boundary-tabs p,
.formula-map p,
.quiz-list p {
  margin-bottom: 0;
}

.doc-details {
  margin-top: 16px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
  overflow: hidden;
}

.doc-details summary {
  padding: 16px 18px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  list-style-position: inside;
}

.doc-details > p,
.doc-details > .tensor-ladder,
.doc-details > .tensor-board,
.doc-details > .formula-panel,
.doc-details > .notation-grid {
  margin: 0 18px 18px;
}

.stress-transform-expansion {
  margin: 0 18px 18px;
  padding: 16px 18px;
  border: 1px solid #d8e1e5;
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
}

.stress-transform-expansion p {
  margin: 0 0 12px;
  color: #394246;
  font-size: 15px;
  line-height: 1.8;
}

.stress-transform-expansion p:last-child {
  margin-bottom: 0;
}

.stress-transform-formula-list {
  display: grid;
  gap: 6px;
  min-width: 760px;
}

.stress-transform-details mjx-container {
  font-size: 108% !important;
}

.tensor-ladder {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tensor-details {
  background: #fff;
}

.tensor-board {
  padding: 22px;
  border: 1px solid #d5deec;
  border-radius: 8px;
  background:
    radial-gradient(circle at 14% 18%, rgba(77, 140, 78, 0.08), transparent 28%),
    radial-gradient(circle at 56% 18%, rgba(29, 100, 173, 0.08), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(109, 64, 170, 0.1), transparent 30%),
    #fbfcff;
}

.tensor-board-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.tensor-board-title span {
  height: 2px;
  background: #2a4c91;
}

.tensor-board-title h3 {
  margin: 0;
  color: #0b2c5c;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.05;
  text-align: center;
}

.tensor-stage {
  display: grid;
  grid-template-columns: 1fr 1fr 1.65fr;
  gap: 18px;
}

.tensor-card {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 18px 16px;
  border: 2px solid var(--tensor-color, #d8dddf);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.tensor-card:hover,
.tensor-card:focus-visible,
.tensor-card.is-selected {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(20, 38, 64, 0.13);
  background: #fff;
}

.tensor-card.scalar {
  --tensor-color: #5d8ea6;
  --tensor-strong: #2d627d;
}

.tensor-card.vector {
  --tensor-color: #6aa0dd;
  --tensor-strong: #1d64ad;
}

.tensor-card.tensor {
  --tensor-color: #b49bd8;
  --tensor-strong: #6d40aa;
}

.tensor-card strong {
  display: block;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--tensor-strong), color-mix(in srgb, var(--tensor-strong) 70%, #fff));
  color: #fff;
  font-size: 22px;
  line-height: 1.2;
  text-align: center;
}

.tensor-card strong em {
  font-style: normal;
  opacity: 0.9;
}

.tensor-card > p {
  margin: 12px 0;
  color: var(--tensor-strong);
  font-weight: 900;
  text-align: center;
}

.tensor-card small {
  display: block;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed color-mix(in srgb, var(--tensor-color) 70%, #fff);
  color: #171e21;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.scalar-visual,
.vector-visual,
.tensor-visual {
  display: grid;
  min-height: 190px;
  place-items: center;
}

.scalar-visual {
  grid-template-columns: 80px 1fr;
  gap: 16px;
}

.thermometer {
  position: relative;
  width: 44px;
  height: 148px;
  border: 6px solid #b8bdc0;
  border-radius: 24px;
  background: #fff;
}

.thermometer::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -28px;
  width: 62px;
  height: 62px;
  border: 6px solid #b8bdc0;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}

.thermometer i {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 16px;
  height: 102px;
  border-radius: 12px;
  background: linear-gradient(#ff714f, #dd2e22);
  transform: translateX(-50%);
  z-index: 1;
}

.thermometer i::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #dd2e22;
  transform: translateX(-50%);
}

.scalar-value,
.vector-formula {
  padding: 12px 16px;
  border: 2px solid color-mix(in srgb, var(--tensor-color) 72%, #fff);
  border-radius: 8px;
  background: color-mix(in srgb, var(--tensor-color) 14%, #fff);
  color: var(--tensor-strong);
  font-size: 20px;
  font-weight: 900;
}

.vector-visual svg {
  width: min(100%, 230px);
  height: auto;
}

.tensor-visual {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.matrix-box {
  width: 100%;
  min-width: 180px;
  padding: 12px;
  border: 1px solid #d7cbe8;
  border-radius: 10px;
  background: #fff;
}

.cube-stack {
  position: relative;
  width: 160px;
  height: 132px;
}

.cube-stack span {
  position: absolute;
  width: 92px;
  height: 92px;
  border: 2px solid #567ca9;
  background:
    linear-gradient(90deg, transparent 30%, rgba(86, 124, 169, 0.25) 31%, transparent 32%, transparent 63%, rgba(86, 124, 169, 0.25) 64%, transparent 65%),
    linear-gradient(0deg, transparent 30%, rgba(86, 124, 169, 0.25) 31%, transparent 32%, transparent 63%, rgba(86, 124, 169, 0.25) 64%, transparent 65%),
    rgba(189, 220, 247, 0.72);
}

.cube-stack span:nth-child(1) { left: 0; top: 40px; }
.cube-stack span:nth-child(2) { left: 18px; top: 28px; }
.cube-stack span:nth-child(3) { left: 36px; top: 16px; }
.cube-stack span:nth-child(4) { left: 54px; top: 4px; background-color: rgba(205, 185, 238, 0.72); }

.tensor-flow {
  display: grid;
  grid-template-columns: 180px 1fr 36px 1fr 36px 1fr 36px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid #b9c9e4;
  border-radius: 14px;
  background: #fff;
}

.tensor-flow strong {
  display: grid;
  min-height: 72px;
  place-items: center;
  border-radius: 10px;
  background: #0d3b73;
  color: #fff;
  font-size: 18px;
  text-align: center;
}

.tensor-flow button {
  min-height: 72px;
  border: 0;
  border-radius: 10px;
  background: #f4f7fb;
  color: #0b2c5c;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.tensor-flow button:hover,
.tensor-flow button:focus-visible,
.tensor-flow button.is-selected {
  background: #e8eff2;
  color: var(--accent-strong);
}

.tensor-flow button span {
  color: #4d5a66;
  font-size: 12px;
  font-weight: 700;
}

.tensor-flow i {
  width: 32px;
  height: 3px;
  background: #4e83c5;
}

.tensor-flow i::after {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  margin: -4px 0 0 21px;
  border-top: 3px solid #4e83c5;
  border-right: 3px solid #4e83c5;
  transform: rotate(45deg);
}

.tensor-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.tensor-notes article {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #f0c986;
  border-radius: 14px;
  background: #fffaf0;
}

.tensor-notes article:nth-child(2) {
  border-color: #a9c6ea;
  background: #f3f8ff;
}

.tensor-notes span {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 50%;
  background: #f0a626;
  color: #fff;
  font-weight: 900;
}

.tensor-notes article:nth-child(2) span {
  background: #2b78c2;
}

.tensor-notes p {
  margin: 0;
}

.tensor-detail,
.tensor-summary {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid #d5deec;
  border-radius: 12px;
  background: #fff;
}

.tensor-detail {
  border-left: 5px solid #2b78c2;
}

.tensor-detail strong {
  display: block;
  margin-bottom: 6px;
  color: #0b2c5c;
  font-size: 18px;
}

.tensor-detail p,
.tensor-summary {
  margin-bottom: 0;
}

.tensor-summary {
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  font-size: 16px;
}

.tensor-summary p {
  margin: 0;
}

.tensor-keypoint-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}

.tensor-keypoint {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.tensor-keypoint h4 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-strong);
}

.tensor-keypoint h4 span {
  color: var(--gold);
}

.tensor-keypoint > p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: #394246;
}

.tensor-keypoint > p:last-child {
  margin-bottom: 0;
}

.coord-transform {
  margin-top: 2px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  text-align: center;
}

.coord-transform-svg {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 0 auto;
}

.tensor-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 12px 0 0;
  padding: 14px 16px;
  border: 1px solid #d8dddf;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f9fafb;
}

.tensor-summary::before {
  content: "总结";
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8eff2;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.tensor-board {
  padding: 18px;
  background: #fcfdff;
}

.tensor-stage {
  grid-template-columns: minmax(210px, 1fr) 42px minmax(210px, 1fr) 42px minmax(360px, 1.7fr);
  gap: 14px;
  align-items: stretch;
}

.tensor-connector {
  align-self: center;
  justify-self: center;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(20, 38, 64, 0.16);
  z-index: 2;
}

.tensor-connector--green {
  background: #5e94af;
}

.tensor-connector--blue {
  background: #5165bd;
}

.tensor-card {
  min-height: 392px;
  border-radius: 16px;
  padding: 16px;
}

.tensor-card strong {
  padding: 12px 14px;
  font-size: 28px;
}

.tensor-card > p {
  font-size: 18px;
}

.scalar-visual,
.vector-visual,
.tensor-visual {
  min-height: 230px;
}

.tensor-visual {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.tensor-subpanel {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 230px;
  padding: 14px;
  border: 1px solid #d7cbe8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.tensor-subpanel b {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 0 20px;
  border-radius: 999px;
  background: #6d40aa;
  color: #fff;
  font-size: 16px;
}

.matrix-box {
  min-width: 180px;
  border: 0;
  background: transparent;
}

.matrix-caption {
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid #d7cbe8;
  border-radius: 6px;
  background: #f7f1ff;
}

.cube-stack {
  margin-top: 18px;
}

.tensor-flow {
  grid-template-columns: 190px minmax(90px, 1fr) 34px minmax(90px, 1fr) 34px minmax(90px, 1fr) 34px minmax(90px, 1fr) 52px;
  border-radius: 14px;
}

.tensor-flow strong {
  min-height: 88px;
  border-radius: 12px;
  background: #0d3b73;
  font-size: 20px;
  line-height: 1.4;
}

.tensor-flow button {
  min-height: 88px;
  background: #fff;
}

.flow-ellipsis {
  color: #566aa4;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-align: center;
}

.tensor-notes article {
  grid-template-columns: 82px minmax(0, 1fr);
  min-height: 132px;
}

.tensor-notes article:nth-child(2) {
  grid-template-columns: 82px minmax(0, 1fr) 220px;
}

.note-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
}

.note-icon--orange {
  background: #f0a626;
}

.note-icon--blue {
  background: #2b78c2;
  font-size: 20px;
}

.tensor-notes h3 {
  margin: 0 0 6px;
  color: #f0a626;
  font-size: 24px;
}

.tensor-notes article:nth-child(2) h3 {
  color: #2b78c2;
}

.coordinate-switch {
  width: 220px;
  height: auto;
}

.coordinate-switch text {
  fill: #0b2c5c;
  font-size: 14px;
  font-weight: 800;
}

.tensor-detail {
  display: none;
}

.tensor-svg-board {
  padding: 0;
  border: 0;
  background: transparent;
}

.tensor-svg-figure {
  position: relative;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.tensor-svg-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.tensor-hotspot {
  position: absolute;
  border: 3px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.tensor-hotspot:hover,
.tensor-hotspot:focus-visible,
.tensor-hotspot.is-selected {
  border-color: rgba(31, 122, 104, 0.78);
  background: rgba(31, 122, 104, 0.06);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65), 0 10px 26px rgba(20, 38, 64, 0.16);
  outline: none;
}

.tensor-hotspot--scalar {
  left: 2.4%;
  top: 6.5%;
  width: 26.4%;
  height: 48.2%;
}

.tensor-hotspot--vector {
  left: 30.9%;
  top: 6.5%;
  width: 26.4%;
  height: 48.2%;
}

.tensor-hotspot--tensor {
  left: 59.4%;
  top: 6.5%;
  width: 38.2%;
  height: 48.2%;
}

.tensor-hotspot--higher {
  left: 74.7%;
  top: 61.8%;
  width: 14.8%;
  height: 14.4%;
  border-radius: 12px;
}

.tensor-hotspot--note1 {
  left: 2.4%;
  top: 73.1%;
  width: 45.3%;
  height: 14.8%;
  border-radius: 14px;
}

.tensor-hotspot--note2 {
  left: 49.6%;
  top: 73.1%;
  width: 47.8%;
  height: 14.8%;
  border-radius: 14px;
}

.tensor-interaction-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

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

.formula-panel {
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
  overflow-x: auto;
}

.compare-panel {
  margin: 32px 0;
  padding: 24px 28px;
  border: 1px solid #d8dddf;
  border-radius: 10px;
  background: #f9fafb;
}

.compare-panel h3 {
  margin: 0 0 14px;
  color: var(--accent-strong, #0379b3);
  font-size: 21px;
  font-weight: 700;
}

.compare-panel p {
  margin: 8px 0;
  line-height: 1.7;
}

.compare-panel details {
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #ffffff;
}

.compare-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent, #2b6c8c);
  font-size: 16px;
}

.formula-panel-large {
  padding: 22px;
}

.formula-ref {
  color: var(--accent-strong);
  font-weight: 700;
  border-bottom: 1px dashed var(--accent);
  cursor: pointer;
  position: relative;
}

.formula-ref-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.18);
  z-index: 1000;
  text-align: left;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.6;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease, visibility 120ms ease;
}

.formula-ref-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--accent);
}

.formula-ref-tooltip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 14px;
}

.formula-ref:hover .formula-ref-tooltip,
.formula-ref:focus-within .formula-ref-tooltip {
  opacity: 1;
  visibility: visible;
}

.formula-ref-tooltip .mjx-chtml {
  font-size: 108% !important;
}

.glossary-term {
  color: var(--accent-strong);
  font-weight: 700;
  border-bottom: 1px dashed var(--accent);
  cursor: help;
}

.glossary-popup {
  display: none;
  position: fixed;
  width: 340px;
  max-width: calc(100vw - 32px);
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  z-index: 1000;
  text-align: left;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.65;
  pointer-events: none;
}

.glossary-popup.is-visible {
  display: block;
}

.glossary-popup strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 14px;
}

.glossary-popup p {
  margin: 0;
  font-size: 13px;
}

.formula-panel h3 {
  margin-bottom: 12px;
}

.formula-panel p:last-child {
  margin-bottom: 0;
}

.cauchy-application-panel {
  padding: 20px;
  overflow-x: auto;
  background: #f9fafb;
}

.stress-transform-embed-card {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #d8e1e5;
  border-radius: 8px;
  background: #f9fafb;
}

.stress-transform-embed-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.stress-transform-embed-heading span {
  width: max-content;
  padding: 3px 9px;
  border-radius: 999px;
  color: #025f8d;
  background: #e8eff2;
  font-size: 13px;
  font-weight: 900;
}

.stress-transform-embed-heading strong {
  color: #0b2c5c;
  font-size: 20px;
}

.stress-transform-embed-card > p {
  margin: 0 0 14px;
  color: #394246;
  font-size: 15px;
  line-height: 1.8;
}

.stress-transform-embed {
  display: block;
  width: 100%;
  height: 610px;
  min-height: 0;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f6f7f8;
}

.stress-principal-embed {
  height: 392px;
}

.stress-max-shear-embed {
  height: 392px;
}

.stress-principal-embed-card > p {
  margin: 8px 0 0;
}

.stress-max-shear-embed-card > p {
  margin: 8px 0 0;
}

.cauchy-application-title {
  margin-bottom: 14px;
  padding: 0 0 12px;
  border-bottom: 2px solid rgba(31, 122, 104, 0.28);
}

.cauchy-application-title h3 {
  margin: 0;
  color: #0379b3;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
}

.cauchy-application-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cauchy-application-card {
  padding: 15px 16px;
  border: 1px solid #d8e1e5;
  border-radius: 8px;
  background: #ffffff;
  overflow-x: auto;
}

.cauchy-application-card--intro,
.cauchy-application-card--wide {
  grid-column: 1 / -1;
}

.cauchy-application-card--intro {
  padding: 13px 16px;
  background: #eef4f7;
  border-color: #c7d6de;
}

.cauchy-application-card h4 {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}

.cauchy-application-card p {
  margin: 0 0 9px;
  color: #545e63;
  font-size: 18px;
  line-height: 1.75;
}

.cauchy-application-panel mjx-container[display="true"] {
  margin: 0.45em 0 !important;
  font-size: 96% !important;
}

.formula-label {
  display: inline-flex;
  width: max-content;
  margin: 8px 0 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8eff2;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
}



.notation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.concept-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.equilibrium-expansion-grid article {
  overflow-x: auto;
}

.equilibrium-expansion-grid mjx-container[display="true"] {
  margin: 0.9em 0;
}

.equilibrium-sketch svg text {
  fill: #333c41;
  font-size: 16px;
  font-weight: 700;
}

.force-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f3f8fa;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

article.force-card {
  background: #f3f8fa;
}

.force-card-content {
  display: grid;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
}

.force-card-content h3 {
  margin: 0;
  color: #0b2c5c;
  font-size: 18px;
}

.force-card-content p {
  margin: 0;
  color: #171e21;
  font-size: 14px;
  line-height: 1.6;
}

.force-card-figure {
  display: grid;
  flex: 0 0 245px;
  place-items: center;
  margin: 0;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.force-card-figure--formula {
  align-self: end;
  margin-bottom: 32px;
}

.force-card-figure img {
  display: block;
  width: 100%;
  max-width: 245px;
  height: auto;
  border-radius: 6px;
}

.body-force-formula,
.surface-force-formula {
  margin-top: 0;
  padding: 10px 12px;
  border: 1px solid #e0e3e4;
  border-radius: 6px;
  background: #fff;
  color: #111;
}

.body-force-equations,
.surface-force-equations {
  display: flex;
  align-items: center;
  gap: 0;
  color: #111;
  overflow: visible;
}

.body-force-main mjx-container,
.body-force-components mjx-container,
.surface-force-main mjx-container,
.surface-force-components mjx-container {
  margin: 0 !important;
  color: #111;
}

.body-force-main mjx-container,
.surface-force-main mjx-container {
  font-size: 108%;
}

.body-force-main,
.surface-force-main {
  flex: 0 0 176px;
  min-width: 176px;
}

.body-force-components,
.surface-force-components {
  display: grid;
  justify-items: start;
  flex: 1 1 auto;
  min-width: 210px;
  gap: 12px;
  margin-left: -2px;
}

.body-force-components mjx-container,
.surface-force-components mjx-container {
  font-size: 100%;
}

.body-force-brace,
.surface-force-brace {
  display: flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  color: #111;
  font-family: "Times New Roman", serif;
  font-size: 122px;
  font-weight: 400;
  line-height: 0.72;
  margin: -5px -8px 0 -16px;
  transform: scaleX(0.28);
  transform-origin: center center;
}

.body-force-dimension,
.surface-force-dimension {
  margin: 9px 0 0;
  color: #111 !important;
  font-size: 14px;
  line-height: 1.7;
}

.body-force-dimension mjx-container,
.surface-force-dimension mjx-container {
  color: #111;
}

.stress-cube-layout,
.split-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: center;
  margin-top: 18px;
}

.stress-cube {
  position: relative;
  min-height: 280px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(31, 122, 104, 0.08), rgba(69, 108, 145, 0.08));
  perspective: 820px;
}

.cube-face {
  position: absolute;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 2px solid rgba(31, 122, 104, 0.75);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(31, 53, 45, 0.12);
  color: var(--accent-strong);
  text-align: center;
  transition: transform 180ms ease, border-color 180ms ease;
}

.cube-face span,
.cube-face small {
  display: block;
}

.cube-face span {
  font-weight: 900;
}

.cube-face small {
  color: var(--muted);
  font-size: 12px;
}

.cube-face:hover,
.cube-face:focus-visible {
  border-color: var(--gold);
  transform: translateY(-4px) scale(1.03);
}

.face-front {
  left: 54px;
  top: 92px;
}

.face-right {
  left: 140px;
  top: 58px;
  transform: skewY(-16deg);
}

.face-right:hover,
.face-right:focus-visible {
  transform: skewY(-16deg) translateY(-4px) scale(1.03);
}

.face-top {
  left: 86px;
  top: 28px;
  transform: skewX(-28deg) scaleY(0.72);
}

.face-top:hover,
.face-top:focus-visible {
  transform: skewX(-28deg) scaleY(0.72) translateY(-4px) scale(1.03);
}

.stress-components-static-figure {
  max-width: 420px;
  margin: 12px auto 18px;
}

.stress-component-demo {
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.stress-component-canvas {
  overflow-x: auto;
  border: 1px solid #dfe4e7;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
}

.stress-component-svg {
  display: block;
  width: 100%;
  max-width: 760px;
  min-width: 560px;
  height: auto;
  margin: 0 auto;
}

.stress-face-base {
  stroke: rgba(233, 35, 35, 0.88);
  stroke-width: 6;
  stroke-linejoin: round;
}

.stress-face-front-base {
  fill: rgba(255, 255, 255, 0.94);
}

.stress-face-top-base {
  fill: rgba(255, 250, 250, 0.9);
}

.stress-face-right-base {
  fill: rgba(255, 218, 218, 0.82);
}

.stress-edge {
  stroke: #f01818;
  stroke-width: 6;
  stroke-linecap: round;
}

.stress-hidden-edge {
  fill: none;
  stroke: #f01818;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 18 18;
  opacity: 0.75;
}

.stress-face-hotspot {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
  outline: none;
  pointer-events: all;
}

.stress-component-demo[data-active-face="front"] .stress-face-front-base,
.stress-component-demo[data-active-face="top"] .stress-face-top-base,
.stress-component-demo[data-active-face="right"] .stress-face-right-base {
  filter: drop-shadow(0 10px 14px rgba(31, 53, 45, 0.16));
  stroke: #d9962c;
}

.stress-component-layer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.stress-component-demo[data-active-face="front"][data-sign="positive"] .component-front.component-positive,
.stress-component-demo[data-active-face="front"][data-sign="negative"] .component-front.component-negative,
.stress-component-demo[data-active-face="top"][data-sign="positive"] .component-top.component-positive,
.stress-component-demo[data-active-face="top"][data-sign="negative"] .component-top.component-negative,
.stress-component-demo[data-active-face="right"][data-sign="positive"] .component-right.component-positive,
.stress-component-demo[data-active-face="right"][data-sign="negative"] .component-right.component-negative {
  opacity: 1;
}

.normal-vector,
.shear-vector,
.shear-vector-alt {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.normal-vector {
  stroke: #c6362d;
}

.shear-vector {
  stroke: #2367b1;
}

.shear-vector-alt {
  stroke: #7a3eb1;
}

.negative-vector {
  stroke-dasharray: 10 8;
}

.stress-label {
  font-family: "Times New Roman", "Noto Serif SC", serif;
  font-size: 30px;
  font-style: italic;
  font-weight: 700;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
  filter: url("#stress-label-shadow");
}

.normal-label {
  fill: #c6362d;
}

.shear-label {
  fill: #2367b1;
}

.shear-alt-label {
  fill: #7a3eb1;
}

.stress-sign-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.stress-sign-button {
  border: 1px solid #bfcacf;
  border-radius: 999px;
  background: #fff;
  color: #394246;
  padding: 7px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.stress-sign-button:hover,
.stress-sign-button:focus-visible,
.stress-sign-button.is-active {
  border-color: var(--accent-strong);
  background: #e8eff2;
  color: var(--accent-strong);
}

.stress-component-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}
.stress-component-hint mjx-container {
  font-size: inherit;
}

/* ---------- 2.3 微元体受力分析互动图 ---------- */
.equilibrium-demo {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  margin: 20px 0;
}

.equilibrium-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 10px;
  background: #f8fafb;
  border-right: 1px solid #d8dddf;
}

.equilibrium-dir-btn {
  display: block;
  width: 100%;
  padding: 12px 10px;
  border: 1px solid #d8dddf;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 140ms ease;
}

.equilibrium-dir-btn + .equilibrium-dir-btn {
  margin-top: 8px;
}

.equilibrium-dir-btn:hover {
  border-color: var(--accent);
  background: #edf3f6;
}

.equilibrium-dir-btn.is-active {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #fff;
}

.equilibrium-canvas {
  overflow-x: auto;
  border-bottom: 1px solid #dfe4e7;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
}

.equilibrium-svg {
  display: block;
  width: 100%;
  max-width: 760px;
  min-width: 520px;
  height: auto;
  margin: 0 auto;
}

/* 方向层默认隐藏 */
.eq-layer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.equilibrium-demo[data-direction="x"] .eq-layer-x,
.equilibrium-demo[data-direction="y"] .eq-layer-y,
.equilibrium-demo[data-direction="z"] .eq-layer-z,
.equilibrium-demo[data-direction="AA"] .eq-layer-AA,
.equilibrium-demo[data-direction="BB"] .eq-layer-BB,
.equilibrium-demo[data-direction="CC"] .eq-layer-CC {
  opacity: 1;
  pointer-events: all;
}

/* 箭头样式：绿色为坐标正向，蓝色为坐标反向 */
.eq-vector-positive,
.eq-vector-negative,
.eq-vector-body {
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.eq-vector-positive {
  stroke: #0379b3;
}

.eq-vector-negative {
  stroke: #2367b1;
}

.eq-vector-body {
  stroke: #c58b2b;
  stroke-dasharray: 6 4;
}

.eq-axis-line {
  fill: none;
  stroke: #1d2326;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.eq-moment-axis {
  fill: none;
  stroke: #456c91;
  stroke-width: 2.5;
  stroke-dasharray: 8 6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* ---- 第 2 章公式自动编号 - 由 MathJax \begin{equation} 原生处理 ---- */
.eq-ch2-num {
  margin: 1.2em 0;
}

.eq-axis-label {
  pointer-events: none;
  overflow: visible;
}

.eq-axis-label > div {
  color: #1d2326;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

/* 公式标签 */
.eq-math-label {
  pointer-events: none;
  overflow: visible;
}

.eq-math-label > div {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 58px;
  min-height: 28px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  filter: drop-shadow(0 2px 3px rgba(31, 53, 45, 0.14));
}

.eq-label-positive > div,
.eq-label-positive mjx-container {
  color: #0379b3 !important;
}

.eq-label-negative > div,
.eq-label-negative mjx-container {
  color: #2367b1 !important;
}

.eq-label-body > div,
.eq-label-body mjx-container {
  color: #a46d19 !important;
}

.equilibrium-hint {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 18px;
  background: #f9fafb;
  border-top: 1px solid #d8dddf;
  font-size: 14px;
  color: #4a565c;
  text-align: center;
}

.equilibrium-hint mjx-container {
  font-size: inherit;
}

.equilibrium-hint .eq-positive-text,
.equilibrium-hint .eq-negative-text {
  font-weight: 700;
}

.equilibrium-hint .eq-positive-text,
.equilibrium-hint .eq-positive-text mjx-container {
  color: #0379b3 !important;
}

.equilibrium-hint .eq-negative-text,
.equilibrium-hint .eq-negative-text mjx-container {
  color: #2367b1 !important;
}

/* ---------- 2.4 柯西四面体面元互动图 ---------- */
.cauchy-tetrahedron-demo {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  margin: 18px auto;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  max-width: 760px;
}

.cauchy-face-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 10px;
  background: #f4f9fb;
  border-right: 1px solid #d4e1e7;
}

.cauchy-face-btn {
  display: block;
  width: 100%;
  padding: 12px 8px;
  border: 1px solid #cedde5;
  border-radius: 6px;
  background: #fff;
  color: #163747;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.cauchy-face-btn:hover,
.cauchy-face-btn:focus-visible {
  border-color: #1e84b7;
  background: #eef6fa;
  outline: none;
}

.cauchy-face-btn.is-active {
  border-color: #116792;
  background: #13709e;
  color: #fff;
  box-shadow: 0 6px 16px rgba(22, 143, 155, 0.2);
}

.cauchy-svg-panel {
  overflow-x: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f6fafc 100%);
}

.cauchy-tetrahedron-svg {
  display: block;
  width: 100%;
  max-width: 640px;
  min-width: 460px;
  height: auto;
  margin: 0 auto;
}

.cauchy-axis,
.cauchy-edges line {
  fill: none;
  stroke: #1d2326;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cauchy-axis {
  stroke-width: 2.2;
}

.cauchy-face-base {
  stroke: #547484;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.cauchy-base-oab {
  fill: rgba(125, 211, 252, 0.24);
}

.cauchy-base-oac {
  fill: rgba(254, 240, 138, 0.26);
}

.cauchy-base-obc {
  fill: rgba(254, 215, 170, 0.28);
}

.cauchy-base-abc {
  fill: rgba(153, 246, 228, 0.22);
}

.cauchy-face-highlight {
  opacity: 0;
  stroke: #1481b8;
  stroke-width: 3.2;
  fill: rgba(103, 232, 249, 0.32);
  transition: opacity 160ms ease;
  vector-effect: non-scaling-stroke;
}

.cauchy-tetrahedron-demo[data-active-face="obc"] .cauchy-highlight-obc,
.cauchy-tetrahedron-demo[data-active-face="oac"] .cauchy-highlight-oac,
.cauchy-tetrahedron-demo[data-active-face="oab"] .cauchy-highlight-oab,
.cauchy-tetrahedron-demo[data-active-face="abc"] .cauchy-highlight-abc {
  opacity: 1;
}

.cauchy-face-layer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.cauchy-tetrahedron-demo[data-active-face="obc"] .cauchy-layer-obc,
.cauchy-tetrahedron-demo[data-active-face="oac"] .cauchy-layer-oac,
.cauchy-tetrahedron-demo[data-active-face="oab"] .cauchy-layer-oab,
.cauchy-tetrahedron-demo[data-active-face="abc"] .cauchy-layer-abc {
  opacity: 1;
}

.cauchy-stress-vector,
.cauchy-normal-vector,
.cauchy-resultant-vector {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cauchy-stress-vector {
  stroke: #1d4ed8;
  stroke-width: 2.55;
}

.cauchy-normal-vector {
  stroke: #7c3aed;
  stroke-width: 2.45;
}

.cauchy-resultant-vector {
  stroke: #01679a;
  stroke-width: 2.75;
}

.cauchy-component-dash {
  stroke-dasharray: 5 4;
}

.cauchy-point-labels circle {
  fill: #1d2326;
}

.cauchy-axis-label,
.cauchy-point-label,
.cauchy-component-label,
.cauchy-normal-label,
.cauchy-resultant-label {
  pointer-events: none;
  overflow: visible;
}

.cauchy-axis-label > div,
.cauchy-point-label > div,
.cauchy-component-label > div,
.cauchy-normal-label > div,
.cauchy-resultant-label > div {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 26px;
  min-height: 28px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: #1d2326;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.cauchy-component-label > div,
.cauchy-component-label mjx-container {
  color: #1d4ed8 !important;
}

.cauchy-normal-label > div,
.cauchy-normal-label mjx-container {
  color: #7c3aed !important;
}

.cauchy-resultant-label > div,
.cauchy-resultant-label mjx-container {
  color: #01679a !important;
}

.cauchy-face-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 18px;
  background: #f5fafc;
  border-top: 1px solid #d4e1e7;
  color: #304d5c;
  font-size: 15px;
  line-height: 1.65;
  text-align: center;
}

.cauchy-face-note mjx-container {
  font-size: inherit;
}

.cauchy-tetrahedron-demo figcaption {
  grid-column: 1 / -1;
  padding: 10px 14px;
  border-top: 1px solid #d4e1e7;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.compare-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.compare-row details {
  margin-top: 12px;
  border: 1px solid #d8dddf;
  border-radius: 6px;
  background: #f9fafb;
  overflow: hidden;
}

.compare-row summary {
  padding: 10px 14px;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  list-style-position: inside;
}

.compare-row details p {
  margin: 0 14px 12px;
  font-size: 13px;
  line-height: 1.55;
}

.derivation-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.derivation-flow article,
.step-list li {
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #fff;
}

.derivation-flow article {
  padding: 16px;
}

.derivation-flow span,
.step-list span {
  display: inline-grid;
  min-width: 32px;
  min-height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #e8eff2;
  color: var(--accent-strong);
  font-weight: 900;
}

.derivation-flow p {
  margin: 10px 0 0;
}

.split-layout {
  align-items: stretch;
}

.sketch-card {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.sketch-card svg {
  width: min(100%, 340px);
  height: auto;
}

.step-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
}

.step-list p {
  margin-bottom: 0;
}

.boundary-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.formula-map {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.formula-map p {
  color: var(--ink);
  font-weight: 800;
}

.quiz-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.chapter-next {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.chapter-next a {
  color: var(--accent-strong);
  font-weight: 900;
}

.chapter-next span {
  color: var(--muted);
}

.MathJax,
mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

@media (max-width: 1080px) {
  .chapter-route,
  .learning-goals,
  .tensor-ladder,
  .concept-grid,
  .derivation-flow,
  .boundary-tabs,
  .formula-map,
  .quiz-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notation-grid {
    grid-template-columns: 1fr;
  }

  .stress-cube-layout,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .body-force-equations,
  .surface-force-equations {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .body-force-brace,
  .surface-force-brace {
    display: none;
  }

  .force-card {
    flex-direction: column;
    gap: 12px;
  }

  .force-card-figure {
    flex-basis: auto;
    justify-self: center;
    width: 100%;
    max-width: 280px;
  }

  .tensor-stage {
    grid-template-columns: 1fr;
  }

  .tensor-flow {
    grid-template-columns: 1fr;
  }

  .tensor-flow i {
    justify-self: center;
    width: 3px;
    height: 28px;
  }

  .tensor-flow i::after {
    margin: 17px 0 0 -4px;
    transform: rotate(135deg);
  }

  .tensor-notes {
    grid-template-columns: 1fr;
  }

  .tensor-keypoint-grid {
    grid-template-columns: 1fr;
  }

  .cauchy-application-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .chapter-route,
  .learning-goals,
  .tensor-ladder,
  .concept-grid,
  .compare-row,
  .derivation-flow,
  .boundary-tabs,
  .formula-map,
  .quiz-list {
    grid-template-columns: 1fr;
  }

  .equilibrium-demo,
  .cauchy-tetrahedron-demo {
    grid-template-columns: 1fr;
  }

  .equilibrium-controls,
  .cauchy-face-controls {
    flex-direction: row;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid #d8dddf;
  }

  .equilibrium-dir-btn,
  .cauchy-face-btn {
    flex: 1;
    font-size: 13px;
    padding: 10px 8px;
  }

  .equilibrium-dir-btn + .equilibrium-dir-btn {
    margin-top: 0;
    margin-left: 8px;
  }

  .cauchy-face-btn + .cauchy-face-btn {
    margin-top: 0;
  }

  .equilibrium-svg,
  .cauchy-tetrahedron-svg {
    min-width: 360px;
  }

  .route-detail {
    min-height: auto;
  }

  .stress-cube {
    min-height: 240px;
  }

  .cube-face {
    width: 112px;
    height: 112px;
  }

  .stress-component-demo {
    padding: 10px;
  }

  .stress-component-svg {
    min-width: 520px;
  }

  .stress-sign-controls {
    flex-wrap: wrap;
  }

  .face-front {
    left: 30px;
    top: 94px;
  }

  .face-right {
    left: 110px;
    top: 62px;
  }

  .face-top {
    left: 62px;
    top: 34px;
  }

  .step-list li {
    grid-template-columns: 1fr;
  }

  .docs-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tensor-board {
    padding: 14px;
  }

  .tensor-board-title {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tensor-board-title span {
    display: none;
  }

  .tensor-board-title h3 {
    font-size: 30px;
  }

  .tensor-card {
    min-height: auto;
  }

  .scalar-visual,
  .tensor-visual {
    grid-template-columns: 1fr;
  }

  .tensor-notes article {
    grid-template-columns: 1fr;
  }

  .cauchy-application-panel {
    padding: 14px;
  }

  .stress-transform-embed {
    height: 1120px;
  }
}

.method-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.method-equation span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--accent-strong);
  background: #e8eff2;
  font-weight: 800;
}

.method-equation strong {
  color: var(--gold);
  font-size: 20px;
}

.method-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.application-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 22px 0;
}

.application-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
}

.application-grid img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #fff;
}

.application-grid figcaption {
  padding: 10px 12px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
}

.doc-steps,
.doc-list {
  margin: 16px 0 0;
  padding-left: 22px;
  color: #394246;
}

.doc-steps li,
.doc-list li {
  margin: 10px 0;
}

.assumption-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.assumption-list article {
  padding: 16px;
}

.assumption-list article h3 {
  font-size: 20px;
  margin: 0 0 6px;
}

.method-cards article h3 {
  font-size: 20px;
}

.qian-note h3 {
  font-size: 20px;
  line-height: 1.3;
}

.frontier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0;
}

.frontier-grid article {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr);
  overflow: hidden;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  background: #f9fafb;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.frontier-grid article:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 122, 104, 0.4);
  box-shadow: 0 12px 32px rgba(31, 53, 45, 0.1);
}

.frontier-img {
  overflow: hidden;
  border-bottom: 1px solid #d8dddf;
}

.frontier-img img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #fff;
  transition: transform 320ms ease;
}

.frontier-grid article:hover .frontier-img img {
  transform: scale(1.04);
}

.frontier-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.frontier-text {
  padding: 20px;
}

.frontier-text h4 {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 20px;
  line-height: 1.3;
}

.frontier-text p {
  margin-bottom: 0;
  color: #4c555a;
  font-size: 16px;
  line-height: 1.7;
}

.doc-quote {
  margin-top: 20px;
  padding: 20px;
  border-left: 4px solid var(--gold);
}

.doc-quote p {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.doc-quote span {
  color: var(--muted);
  font-size: 14px;
}

.chapter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.chapter-grid a {
  padding: 14px 16px;
  border: 1px solid #d8dddf;
  border-radius: 8px;
  color: var(--accent-strong);
  background: #f9fafb;
  font-weight: 800;
}

.site-footer {
  padding: 28px 6vw;
  text-align: center;
  border-top: 1px solid #d8dddf;
  background: #f7f8f9;
}

.docs-body.footer-fixed .site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9000;
  min-height: var(--fixed-footer-height);
  padding: 8px 6vw;
  background: rgba(247, 249, 247, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 -8px 24px rgba(23, 33, 29, 0.08);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.docs-example,
.docs-lab,
.docs-tools {
  margin-top: 18px;
}

@media (max-width: 1080px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #d8dddf;
  }

  .sidebar-section {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sidebar-title {
    width: 100%;
  }

  .doc-article {
    max-width: none;
    padding: 42px 5vw 76px;
  }
}

@media (max-width: 760px) {
  .docs-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 5vw;
  }

  .docs-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .doc-summary,
  .callout-grid,
  .assumption-list,
  .chapter-grid,
  .concept-flow,
  .deformation-compare,
  .object-labels,
  .timeline,
  .method-cards,
  .application-grid,
  .frontier-grid,
  .frontier-grid--three,
  .scientist-panel,
  .task-layout,
  .timeline-detail,
  .subject-map,
  .method-brief {
    grid-template-columns: 1fr;
  }

  .doc-article h1 {
    font-size: 36px;
  }

  .relation-map {
    grid-template-columns: 1fr;
  }

  .relation-center,
  .relation-detail,
  .subject-detail {
    grid-column: auto;
  }

  .method-flow-diagram {
    grid-template-columns: 1fr;
  }

  .method-flow-diagram span {
    width: 2px;
    height: 24px;
    justify-self: center;
  }

  .method-flow-diagram span::after {
    top: auto;
    right: -5px;
    bottom: -2px;
    border-top: 9px solid var(--accent);
    border-right: 6px solid transparent;
    border-left: 6px solid transparent;
    border-bottom: 0;
  }

  .task-list li {
    grid-template-columns: 1fr;
  }

  .scientist-card img {
    height: auto;
    max-height: 300px;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 6vw;
  border-bottom: 1px solid rgba(216, 223, 217, 0.82);
  background: rgba(245, 247, 244, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  color: var(--accent-strong);
}

.section,
.section-band {
  padding: 88px 6vw;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  align-items: center;
  gap: 56px;
  min-height: calc(100vh - 72px);
}

.platform-hero {
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1fr);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
}

.button.primary {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.button.secondary {
  background: var(--surface);
}

.hero-board {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(31, 122, 104, 0.12), rgba(69, 108, 145, 0.08)),
    #ffffff;
  box-shadow: var(--shadow);
}

.map-preview {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(31, 122, 104, 0.12), rgba(197, 139, 43, 0.12)),
    #fff;
  box-shadow: var(--shadow);
}

.map-node {
  position: absolute;
  top: 42px;
  left: 42px;
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.map-line {
  position: absolute;
  top: 112px;
  right: 80px;
  left: 184px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(31, 122, 104, 0.08));
}

.map-cluster {
  position: absolute;
  top: 66px;
  right: 38px;
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 14px;
}

.map-cluster a,
.demo-gateway {
  border: 1px solid rgba(216, 223, 217, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.08);
}

.map-cluster a {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
  font-weight: 800;
}

.demo-gateway {
  position: absolute;
  right: 38px;
  bottom: 42px;
  left: 38px;
  padding: 28px;
  color: #fff;
  background: #171e21;
}

.demo-gateway span,
.demo-gateway strong {
  display: block;
}

.demo-gateway span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 700;
}

.demo-gateway strong {
  margin-top: 8px;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.18;
}

.intro-board {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(31, 122, 104, 0.12), rgba(69, 108, 145, 0.1)),
    #fff;
  box-shadow: var(--shadow);
  padding: 42px;
}

.intro-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(23, 33, 29, 0.08);
  padding: 24px;
}

.intro-card.large {
  margin-right: 76px;
}

.intro-card.dark {
  margin-top: 34px;
  margin-left: 78px;
  color: #fff;
  background: #171e21;
}

.intro-card span,
.intro-card strong {
  display: block;
}

.intro-card span {
  color: var(--gold);
  font-weight: 900;
}

.intro-card strong {
  margin-top: 8px;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.18;
}

.intro-arrow {
  margin: 26px 0 0 50%;
  color: var(--accent);
  font-size: 42px;
  font-weight: 900;
}

.intro-grid {
  position: absolute;
  right: 42px;
  bottom: 42px;
  left: 42px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.intro-grid span {
  display: grid;
  min-height: 76px;
  place-items: center;
  border: 1px solid rgba(31, 122, 104, 0.28);
  border-radius: var(--radius);
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.76);
  font-weight: 800;
  text-align: center;
}

.tensor-card {
  position: absolute;
  top: 44px;
  left: 42px;
  width: 180px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
}

.tensor-card.accent {
  top: 172px;
  right: 42px;
  left: auto;
}

.tensor-card span,
.tensor-card strong {
  display: block;
}

.tensor-card span {
  color: var(--muted);
  font-size: 14px;
}

.tensor-card strong {
  margin-top: 12px;
  color: var(--accent-strong);
  font-family: Georgia, serif;
  font-size: 42px;
}

.formula-strip {
  position: absolute;
  right: 36px;
  bottom: 46px;
  left: 36px;
  padding: 18px 20px;
  border-radius: var(--radius);
  color: #fff;
  background: #171e21;
  font-weight: 700;
  text-align: center;
}

.mesh {
  position: absolute;
  right: 62px;
  bottom: 132px;
  display: grid;
  grid-template-columns: repeat(4, 44px);
  gap: 9px;
  transform: skewY(-11deg);
}

.mesh span {
  display: block;
  height: 38px;
  border: 1px solid rgba(31, 122, 104, 0.5);
  background: rgba(31, 122, 104, 0.12);
}

.section-heading {
  max-width: 860px;
  margin-bottom: 34px;
}

.section-heading.narrow {
  max-width: 680px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.14;
}

.section-heading p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.platform-grid,
.guide-grid,
.derivation-grid,
.quiz-grid,
.admin-grid,
.goal-grid,
.relation-grid,
.method-flow,
.assumption-grid,
.meaning-grid {
  display: grid;
  gap: 18px;
}

.platform-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.platform-card,
.guide-grid article,
.derivation-grid article,
.quiz-grid article,
.admin-grid article,
.goal-grid article,
.relation-grid article,
.method-flow article,
.assumption-grid article,
.meaning-grid article,
.calculator-card,
.calculator-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 33, 29, 0.06);
}

.platform-card {
  display: block;
  min-height: 212px;
  padding: 24px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.platform-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.platform-card span,
.derivation-grid span {
  color: var(--gold);
  font-weight: 900;
}

.platform-card h3,
.guide-grid h3,
.derivation-grid h3,
.quiz-grid h3,
.admin-grid h3,
.calculator-card h3,
.calculator-result h3 {
  margin: 10px 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.platform-card p,
.guide-grid p,
.derivation-grid p,
.quiz-grid p,
.calculator-result p {
  margin: 0;
  color: var(--muted);
}

.guide-section,
.tools-section {
  background: #eef1f2;
}

.guide-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guide-grid article,
.derivation-grid article,
.quiz-grid article,
.admin-grid article,
.goal-grid article,
.relation-grid article,
.method-flow article,
.assumption-grid article,
.meaning-grid article {
  padding: 24px;
}

.goal-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.goal-grid span,
.method-flow span {
  color: var(--gold);
  font-weight: 900;
}

.goal-grid h3,
.relation-grid h3,
.method-flow h3,
.assumption-grid h3,
.meaning-grid h3 {
  margin: 10px 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.goal-grid p,
.relation-grid p,
.method-flow p,
.assumption-grid p,
.meaning-grid p {
  margin: 0;
  color: var(--muted);
}

.relation-section,
.meaning-section {
  background: #fff;
}

.relation-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.method-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.method-flow article {
  position: relative;
  min-height: 220px;
}

.method-flow article::after {
  content: "";
  position: absolute;
  top: 36px;
  right: -22px;
  width: 26px;
  height: 2px;
  background: var(--accent);
}

.method-flow article:last-child::after {
  display: none;
}

.assumption-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meaning-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-layout,
.example-panel,
.lab-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 24px;
}

.module-tabs,
.control-panel,
.problem-card,
.step-card,
.module-detail,
.roadmap-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 33, 29, 0.06);
}

.module-tabs {
  display: grid;
  align-self: start;
  overflow: hidden;
}

.module-tab {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.module-tab:last-child {
  border-bottom: 0;
}

.module-tab.is-active {
  color: #fff;
  background: var(--accent);
}

.module-detail {
  min-height: 360px;
  padding: 36px;
}

.module-kicker {
  width: fit-content;
  margin-bottom: 18px;
  color: var(--gold);
  font-weight: 800;
}

.module-detail h3,
.problem-card h3,
.step-card h3,
.roadmap-grid h3 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.25;
}

.module-detail p,
.module-detail li,
.problem-card p,
.step-card p,
.roadmap-grid p {
  color: var(--muted);
}

.module-detail ul {
  margin: 24px 0 0;
  padding-left: 22px;
}

.split-section {
  background: #eef1f2;
}

.topic-strip,
.simulation-list,
.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 28px;
}

.topic-strip span,
.simulation-list span,
.tool-list span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.example-panel {
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1fr);
}

.problem-card,
.step-card,
.control-panel {
  padding: 28px;
}

.mini-beam {
  position: relative;
  height: 150px;
  margin-top: 28px;
}

.mini-beam .wall {
  position: absolute;
  left: 0;
  top: 22px;
  width: 18px;
  height: 86px;
  background: repeating-linear-gradient(-45deg, #8c9397 0 4px, #cfd4d6 4px 8px);
}

.mini-beam .beam {
  position: absolute;
  left: 18px;
  top: 58px;
  width: calc(100% - 48px);
  height: 18px;
  background: var(--blue);
}

.mini-beam .load {
  position: absolute;
  right: 26px;
  top: 48px;
  width: 2px;
  height: 74px;
  background: var(--gold);
}

.mini-beam .load::after {
  content: "";
  position: absolute;
  left: -7px;
  bottom: 0;
  border-top: 14px solid var(--gold);
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-strong);
  background: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.formula-box {
  min-height: 68px;
  margin-top: 28px;
  padding: 20px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #f0f5f7;
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
}

.lab-grid {
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: stretch;
}

.derivation-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tools-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.calculator-card,
.calculator-result {
  padding: 28px;
}

.calculator-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}

.calculator-card input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.calculator-card .button {
  width: 100%;
  margin-top: 8px;
  cursor: pointer;
}

.quiz-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid ul {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.control-panel {
  align-self: start;
}

.control-panel label {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--muted);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.result-grid {
  display: grid;
  gap: 12px;
}

.result-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8f9fa;
}

.result-grid span,
.result-grid strong {
  display: block;
}

.result-grid span {
  color: var(--muted);
  font-size: 13px;
}

.result-grid strong {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 20px;
}

.canvas-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.roadmap-grid article {
  padding: 24px;
}

.roadmap-grid span {
  color: var(--gold);
  font-weight: 800;
}

.footer {
  padding: 34px 6vw;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 5vw;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero,
  .module-layout,
  .example-panel,
  .lab-grid,
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 58px;
  }

  .hero-board {
    min-height: 420px;
  }

  .roadmap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-grid,
  .guide-grid,
  .derivation-grid,
  .quiz-grid,
  .goal-grid,
  .relation-grid,
  .method-flow,
  .assumption-grid,
  .meaning-grid,
  .frontier-grid,
  .frontier-grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .method-flow article::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .section,
  .section-band {
    padding: 58px 5vw;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-board {
    min-height: 360px;
  }

  .map-preview {
    min-height: 520px;
  }

  .map-node {
    top: 24px;
    left: 24px;
    width: 110px;
    height: 110px;
    font-size: 20px;
  }

  .map-line {
    display: none;
  }

  .map-cluster {
    top: 154px;
    right: 22px;
    left: 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-gateway {
    right: 22px;
    bottom: 24px;
    left: 22px;
  }

  .tensor-card {
    left: 22px;
    width: 148px;
  }

  .tensor-card.accent {
    right: 22px;
  }

  .mesh {
    right: 32px;
    grid-template-columns: repeat(4, 30px);
  }

  .mesh span {
    height: 28px;
  }

  .roadmap-grid {
    grid-template-columns: 1fr;
  }

  .platform-grid,
  .guide-grid,
  .derivation-grid,
  .quiz-grid,
  .admin-grid,
  .goal-grid,
  .relation-grid,
  .method-flow,
  .assumption-grid,
  .meaning-grid {
    grid-template-columns: 1fr;
  }

  .intro-board {
    min-height: 520px;
    padding: 24px;
  }

  .intro-card.large,
  .intro-card.dark {
    margin-right: 0;
    margin-left: 0;
  }

  .intro-grid {
    right: 24px;
    bottom: 24px;
    left: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============ AI Chat Widget ============ */
.ai-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border: 2px solid #0379b3;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  padding: 0;
  overflow: hidden;
}

.docs-body.footer-fixed .ai-chat-fab {
  bottom: calc(var(--fixed-footer-height) + var(--fixed-widget-gap));
}

.ai-chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.ai-chat-fab img {
  display: block;
  object-fit: cover;
}

.ai-chat-tip {
  position: fixed;
  right: 82px;
  bottom: 38px;
  z-index: 9999;
  background: #0379b3;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.docs-body.footer-fixed .ai-chat-tip {
  bottom: calc(var(--fixed-footer-height) + var(--fixed-widget-gap) + 10px);
}

.ai-chat-tip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 6px solid #0379b3;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.ai-chat-tip.is-hidden {
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
}

.ai-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 9998;
  width: 480px;
  height: 520px;
  min-width: 340px;
  min-height: 380px;
  max-width: calc(100vw - 48px);
  max-height: 80vh;
  background: #fff;
  border: 1px solid #d8dddf;
  border-radius: 12px;
  box-shadow: 0 8px 36px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.docs-body.footer-fixed .ai-chat-panel {
  bottom: calc(var(--fixed-footer-height) + 86px);
  max-height: calc(100vh - var(--fixed-footer-height) - 108px);
}

.ai-chat-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #fff;
  color: #171e21;
  font-size: 15px;
  font-weight: 800;
  border-bottom: 1px solid #d8dddf;
  flex-shrink: 0;
}
.ai-chat-header > span { flex: 1; margin-left: 4px; }
.ai-chat-header button {
  background: none;
  border: none;
  color: #5a6368;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.ai-chat-header button:hover { color: #171e21; }

.ai-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.ai-chat-messages::-webkit-scrollbar { width: 5px; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: #d8dddf; border-radius: 4px; }

.ai-chat-input-wrap {
  display: flex;
  border-top: 1px solid #d8dddf;
  flex-shrink: 0;
}
.ai-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}
.ai-msg.user {
  align-self: flex-end;
  background: #e8eff2;
  color: #171e21;
  border-bottom-right-radius: 4px;
}
.ai-msg.bot {
  align-self: flex-start;
  background: #f9fafb;
  color: #171e21;
  border: 1px solid #d8dddf;
  border-bottom-left-radius: 4px;
}
.ai-msg.bot .mjx-chtml { font-size: 93% !important; }

.ai-msg.ai-welcome {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 6px 0;
}
.ai-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.ai-welcome span {
  background: #f9fafb;
  border: 1px solid #d8dddf;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  line-height: 1.65;
  font-size: 14px;
}

.ai-chat-input-wrap input {
  flex: 1;
  border: none;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.ai-chat-input-wrap input::placeholder { color: #9aa5ab; }
.ai-chat-input-wrap button {
  border: none;
  background: #0379b3;
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.ai-chat-input-wrap button:hover { background: #0b2c5c; }
.ai-chat-input-wrap button:disabled { background: #b8bdc0; cursor: not-allowed; }

.ai-chat-loader {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
}
.ai-chat-loader span {
  width: 7px; height: 7px;
  background: #b8bdc0;
  border-radius: 50%;
  animation: aiBounce 1.2s infinite ease-in-out;
}
.ai-chat-loader span:nth-child(2) { animation-delay: 0.15s; }
.ai-chat-loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiBounce {
  0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.ai-disclaimer {
  font-size: 11px;
  color: #8a959a;
  text-align: center;
  padding: 6px 12px 10px;
  border-top: 1px solid #f0f1f2;
  flex-shrink: 0;
}

/* API Key input */
.ai-key-section {
  display: none;
  border-bottom: 1px solid #d8dddf;
  padding: 10px 12px;
  gap: 8px;
  flex-shrink: 0;
}
.ai-key-section input {
  flex: 1;
  border: 1px solid #d8dddf;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
  background: #fafbfb;
}
.ai-key-section input:focus { border-color: #0379b3; }
.ai-key-section input::placeholder { color: #9aa5ab; }
.ai-key-section button {
  border: none;
  background: #0379b3;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.ai-key-section button:hover { background: #0b2c5c; }

.ai-key-change-btn {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.ai-key-change-btn:hover { opacity: 1; }

.ai-resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, #b8bdc0 30%, transparent 30%, transparent 55%, #b8bdc0 55%, #b8bdc0 70%, transparent 70%);
  z-index: 10;
}
