/* 手机阅读结构：白底、品牌红、可跳转章节和完整可读的分项内容。 */
.mobile-reader-nav, .mobile-path { display: none; }

@media screen and (max-width: 1250px) {
  html { scroll-padding-top: calc(var(--header) + 82px); }
  .mobile-reader-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: var(--header);
    z-index: 15;
    min-height: 56px;
    padding: 6px 0;
    margin: 0 0 26px;
    background: #fff;
    border-top: 1px solid #ededed;
    border-bottom: 1px solid #ededed;
  }
  .mobile-reader-nav label { flex: 0 0 auto; max-width: 120px; color: #606060; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #section-select {
    flex: 1;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 8px 26px 8px 8px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #242424;
    font-size: 16px;
    line-height: 1.5;
    text-overflow: ellipsis;
    cursor: pointer;
  }
}

@media screen and (max-width: 850px) {
  body { font-size: 16px; line-height: 1.9; }
  body.menu-open { overflow: hidden; }
  main { padding: 22px 20px 0; max-width: 720px; }
  .sidebar { width: min(320px, calc(100vw - 36px)); background: #fff; }
  .sidebar .nav-item { min-height: 48px; font-size: 16px; }
  .sidebar-title { font-size: 15px; }
  .breadcrumb { margin-bottom: 18px; }
  .lead, .body-copy { font-size: 16px; line-height: 1.9; }
  .steps > li > p, .steps > li > strong { font-size: 16px; }
  .steps > li { grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; margin-bottom: 22px; padding-bottom: 22px; }
  .steps > li::before { font-size: 16px; }
  .steps > li:last-child { margin-bottom: 0; padding-bottom: 0; }
  .plain-list, .dictionary-list { font-size: 16px; }
  .source-note { font-size: 13px; line-height: 1.85; }
  .small, small { font-size: 14px; line-height: 1.85; }
  .note, .note.warn, .faq > div { font-size: 15px; line-height: 1.9; }
  .faq summary { font-size: 16px; line-height: 1.75; }
  .flow-tabs button { min-height: 48px; font-size: 16px; }
  .setting-row, .setting-row p { font-size: 16px; }
  .page-link { min-height: 64px; font-size: 15px; }
  .document-footer { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .version-line { flex-wrap: wrap; row-gap: 6px; }
  dialog { width: calc(100% - 24px); max-height: calc(100dvh - 32px); padding: 20px; }
  #search-input { font-size: 16px; min-height: 48px; }
  .search-result { padding: 16px 6px; }
  .search-result strong { font-size: 16px; }
  .search-result p { font-size: 14px; line-height: 1.8; }
  .close { min-width: 44px; min-height: 44px; }
}

@media screen and (max-width: 640px) {
  main { padding-inline: 16px; }
  .topbar { padding-inline: 16px; }
  .guide-label { display: none; }
  .header-actions { gap: 6px; }
  .search-trigger { min-width: 44px; min-height: 44px; justify-content: center; }
  .menu { min-height: 44px; padding: 6px 10px; font-size: 15px; }
  .breadcrumb { font-size: 12px; gap: 8px; }
  h1 { font-size: 28px; line-height: 1.45; gap: 10px; }
  h1[data-chapter]::before { flex-basis: 28px; font-size: 17px; }
  h2 { font-size: 22px; line-height: 1.55; margin-top: 36px; }
  h3 { font-size: 18px; line-height: 1.6; }
  .lead { margin-top: 14px; }
  .mobile-reader-nav { gap: 8px; }
  .inventory { padding-inline: 14px; }
  .inventory li { font-size: 16px; }
  .path { border: 0; padding: 0; margin: 18px 0 24px; }
  .path-original { display: none; }
  .mobile-path { display: block; list-style: decimal; margin: 0; padding: 8px 14px 8px 34px; border-left: 2px solid #ca171b; background: #fafafa; }
  .mobile-path li { padding: 6px 0 6px 4px; font-size: 15px; line-height: 1.8; }
  .mobile-path li::marker { color: #ca171b; font: 600 14px ui-monospace, monospace; }
  .path .tag { display: inline; font-size: 13px; margin-right: 8px; padding: 2px 5px; }
  .guide-table { display: block; table-layout: auto; }
  .guide-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
  .guide-table tbody { display: block; }
  .guide-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 14px; padding: 18px 14px; border-bottom: 1px solid #e8e8e8; }
  .guide-table tbody tr:nth-child(even) { background: #fff; }
  .guide-table tbody tr:last-child { border-bottom: 0; }
  .guide-table tbody th, .guide-table tbody td { display: block; min-width: 0; padding: 0; border: 0; font-size: 16px; line-height: 1.85; }
  .guide-table tbody th { font-size: 16px; font-weight: 600; }
  .guide-table.table-multi tbody td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: #606060; font-size: 14px; font-weight: 600; }
  .comparison-table tbody td:nth-child(2), .comparison-table tbody td:nth-child(3) { padding: 0 0 0 12px; background: #fff; border-left: 2px solid #dedede; }
  .comparison-table tbody td:nth-child(3) { border-left-color: #ca171b; }
  .comparison-table.table-multi tbody td:nth-child(2)::before { color: #242424; }
  .comparison-table.table-multi tbody td:nth-child(3)::before { color: #ca171b; }
  .flow-tabs { gap: 22px; }
  .note, .note.warn { padding: 14px 16px; }
}

@media screen and (max-width: 359px) {
  .dictionary-list { grid-template-columns: 1fr; }
  .draft-label { font-size: 10px; padding-inline: 5px; }
}

/* 首次使用的图例独立于缩放画布，部件名称始终以正文尺寸显示。 */
.product-layout { display: flex; align-items: center; gap: 24px; max-width: 508px; margin: 0 auto; }
.product-layout .product-mount { flex: 0 0 342.633px; width: 342.633px; height: 352.899px; margin: 0; }
.product-layout .product-stage { width: 274.106px; transform: scale(1.25); }
.product-layout .product-legend { position: static; flex: 1; width: auto; margin: 0; padding-left: 20px; display: block; font-size: 14px; line-height: 2.2; white-space: nowrap; }
.direction-list, .control-list, .compact-specs, .responsibility-item dl { margin: 0; }
.direction-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; margin: 8px 0; }
.direction-list dt, .control-list dt, .compact-specs dt { font-weight: 600; }
.direction-list dd, .control-list dd, .compact-specs dd, .responsibility-item dd { margin: 0; color: var(--muted); }
.control-list { margin-top: 24px; }
.control-list > div, .compact-specs > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; margin: 14px 0; }
.responsibility-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; margin: 18px 0; }
.responsibility-item h3 { font-size: 16px; line-height: 1.5; margin: 0 0 6px; }
.responsibility-item dl > div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; margin: 3px 0; font-size: 15px; line-height: 1.75; }
.responsibility-item dt { color: #777; font-size: 13px; line-height: 2; }
.responsibility-item dt:first-child { font-weight: 500; }
.responsibility-item dl > div:first-child dt { color: var(--red); }

@media screen and (max-width: 1250px) {
  body[data-page="start"] .mobile-reader-nav { display: none; }
  html[data-page="start"] { scroll-padding-top: calc(var(--header) + 20px); }
}

@media screen and (max-width: 850px) {
  :root { --header: 56px; }
  .brand-logo { gap: 7px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-wordmark { width: 70px; height: 23px; }
  .brand-wordmark img { transform: rotate(-90deg) scale(.77); }
  body[data-page="start"] main { padding-top: 18px; }
  body[data-page="start"] h1, body[data-page="connection"] h1 { font-size: 23px; line-height: 1.4; gap: 9px; margin-bottom: 20px; }
  body[data-page="start"] h1[data-chapter]::before, body[data-page="connection"] h1[data-chapter]::before { flex-basis: 24px; height: 28px; font-size: 16px; }
  body[data-page="start"] h2, body[data-page="connection"] h2 { font-size: 18px; line-height: 1.55; margin: 28px 0 12px; padding: 0; border: 0; }
  body[data-page="start"] h1 + h2 { margin-top: 0; }
  body[data-page="start"] h3 { font-size: 16px; margin: 20px 0 8px; }
  body[data-page="start"] .inventory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: none; margin: 0; padding: 0; border: 0; }
  body[data-page="start"] .inventory li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 9px 10px; border: 0; background: #f7f7f7; font-size: 15px; line-height: 1.6; }
  body[data-page="start"] .inventory li span { white-space: nowrap; }
  body[data-page="start"] .inventory li span:last-child { color: #707070; font: inherit; }
  .inventory-note { font-size: 13px; line-height: 1.75; margin: 8px 0 0; }
  body[data-page="start"] .technical-figure { padding: 0; margin: 12px 0 0; }
  .product-layout { max-width: 430px; gap: 18px; justify-content: center; }
  .product-layout .product-mount { flex-basis: 274.106px; width: 274.106px; height: 282.319px; }
  .product-layout .product-stage { transform: scale(1); }
  .product-layout .product-legend { flex: 0 0 118px; padding-left: 18px; font-size: 14px; line-height: 2.05; }
  body[data-page="start"] .technical-figure figcaption, body[data-page="start"] .joystick-figure figcaption { display: none; }
  body[data-page="start"] .joystick-layout { grid-template-columns: 158.4px minmax(0, 1fr); gap: 20px; margin: 10px 0 18px; }
  body[data-page="start"] .joystick-mount { width: 158.4px; height: 125.4px; }
  body[data-page="start"] .joystick-stage { transform: scale(1.1); }
  body[data-page="start"] .joystick-label { display: none; }
  .direction-list > div { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; margin: 9px 0; font-size: 15px; line-height: 1.7; }
  .direction-list dt { font-size: 14px; }
  .control-list { margin-top: 0; }
  .control-list > div, .compact-specs > div { grid-template-columns: 86px minmax(0, 1fr); gap: 12px; margin: 12px 0; font-size: 15px; line-height: 1.75; }
  .control-list dt, .compact-specs dt { font-size: 14px; }
  body[data-page="start"] .source-note { font-size: 12px; margin: 10px 0; }
  body[data-page="start"] .plain-list { margin: 6px 0; font-size: 15px; }
  body[data-page="start"] .plain-list > li { padding-top: 5px; padding-bottom: 5px; border: 0; line-height: 1.75; }
  body[data-page="start"] .plain-list > li::before { top: 16px; }
  body[data-page="connection"] .steps { margin: 14px 0 20px; }
  body[data-page="connection"] .steps > li { margin-bottom: 16px; padding-bottom: 0; border: 0; column-gap: 10px; }
  body[data-page="connection"] .steps > li > strong, body[data-page="connection"] .steps > li > p { font-size: 15px; line-height: 1.75; }
  body[data-page="connection"] .result { border: 0; padding-top: 0; margin-top: 0; font-size: 14px; }
}

@media screen and (max-width: 640px) {
  .product-layout { gap: 16px; max-width: 364px; }
  .product-layout .product-mount { flex-basis: 208.321px; width: 208.321px; height: 214.562px; }
  .product-layout .product-stage { transform: scale(.76); }
  .product-layout .product-legend { flex-basis: 118px; }
  .responsibility-list { grid-template-columns: 1fr; gap: 20px; margin: 14px 0 20px; }
}

@media screen and (max-width: 389px) {
  .product-layout { gap: 14px; }
  .product-layout .product-mount { flex-basis: 202.838px; width: 202.838px; height: 208.916px; }
  .product-layout .product-stage { transform: scale(.74); }
  .product-layout .product-legend { flex-basis: 110px; }
  body[data-page="start"] .joystick-layout { grid-template-columns: 144px minmax(0, 1fr); gap: 16px; }
  body[data-page="start"] .joystick-mount { width: 144px; height: 114px; }
  body[data-page="start"] .joystick-stage { transform: scale(1); }
}

@media screen and (min-width: 360px) and (max-width: 374px) {
  .product-layout { gap: 12px; }
  .product-layout .product-mount { flex-basis: 186.392px; width: 186.392px; height: 191.977px; }
  .product-layout .product-stage { transform: scale(.68); }
}

@media screen and (max-width: 359px) {
  .product-layout { gap: 12px; }
  .product-layout .product-mount { flex-basis: 150.758px; width: 150.758px; height: 155.275px; }
  .product-layout .product-stage { transform: scale(.55); }
  .product-layout .product-legend { flex-basis: 110px; font-size: 13px; }
  body[data-page="start"] .joystick-layout { grid-template-columns: 132px minmax(0, 1fr); gap: 12px; }
  body[data-page="start"] .joystick-mount { width: 132px; height: 104.5px; }
  body[data-page="start"] .joystick-stage { transform: scale(.916667); }
}
