/* 首页的能力概览和上手入口沿用发行站版心。 */
.home-width { width: var(--site-width); margin-inline: auto; }
:is(.showcase, .evidence-feature, .manuscript-feature, .figure-feature, .slides-feature, .skills-feature, .panorama) h2 > span {
  display: inline-block;
  max-inline-size: 100%;
}
.home-block { padding-block: clamp(3rem, 5vw, 5rem); }
.home-block h2 { font-size: var(--site-section-size); line-height: 1.25; letter-spacing: -.025em; }
.home-block h3 { line-height: 1.3; }
.inline-action { display: inline-flex; align-items: center; gap: .4em; color: var(--jade-ink); font-size: 15px; font-weight: 650; text-decoration: none; }
.inline-action:hover { text-decoration: underline; }
.home-title-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.panorama .home-title-row h2 { max-width: 29ch; }
.home-features { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(14px,1.6vw,24px); margin-top: clamp(25px,3vw,46px); }
.home-feature { min-width: 0; display: flex; flex-direction: column; background: var(--bg-subtle); border-radius: 14px; overflow: hidden; }
.feature-copy { padding: clamp(21px,2.5vw,38px); }
.feature-copy > svg { width: 23px; height: 23px; margin-bottom: 15px; color: var(--ink-secondary); }
.feature-copy h3 { font-size: var(--site-subheading-size); letter-spacing: -.02em; }
.feature-copy p { margin: 9px 0 15px; max-width: 58ch; color: var(--ink-secondary); }
.feature-image { display: block; overflow: hidden; height: clamp(142px,16vw,235px); margin: auto 0 0 clamp(21px,2.5vw,38px); }
.feature-image img { display: block; width: 100%; max-width: none; height: 100%; object-fit: cover; object-position: center top; border-radius: 8px 0 0; }
.feature-image--paper-library img { width: 115%; margin-left: -15%; }
.feature-image--figure-editor img { width: 176%; margin-left: -76%; object-position: right 43%; }
.feature-image--skills img { width: 170%; margin-left: -70%; object-position: right top; }
.feature-image--connected { align-self: center; margin-left: 0; width: min(78%,460px); }
.feature-image--connected img { object-position: center 38%; border-radius: 8px 8px 0 0; }
.feature-image:focus-visible { outline-offset: -3px; }
/* 预览展开时以图稿左上角为坐标原点；两档缩放共用同一窗口，工具条留在原位。 */
.site-viewer, .viewer-scroll img { transform-origin: 0 0; }
.viewer-scroll {
  grid-template: minmax(0,1fr) / minmax(0,1fr);
  height: min(81vh, calc(min(96vw, 1700px) / var(--viewer-ratio, 1.5)));
  height: min(81dvh, calc(min(96vw, 1700px) / var(--viewer-ratio, 1.5)));
}
.viewer-scroll img:not(.is-zoomed) { height: 100%; max-height: none; }
.site-viewer::backdrop { transition: background-color 220ms ease-out; }
.site-viewer.is-closing::backdrop { background-color: transparent; }
@starting-style { .site-viewer[open]::backdrop { background-color: transparent; } }
.home-start { padding-inline: var(--site-gutter); }
.home-start .home-width { width: min(var(--site-max-width), 100%); padding: 0; }
.home-start h2 { text-wrap: balance; }
.start-switcher { margin-top: clamp(22px, 2.6vw, 32px); }
.start-tabs {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  padding: 4px; border-radius: 999px; background: #dfeee5; border: 1px solid #bcd5c6;
}
.start-tabs button {
  min-height: 38px; padding: 7px 18px; border: 0; border-radius: 999px;
  background: transparent; color: #244536; font-size: 15px; font-weight: 600;
}
.start-tabs button:focus-visible { outline-offset: 1px; }
.start-tabs button:hover:not([aria-selected="true"]) { color: #122b1f; background: rgb(23 59 44 / .06); }
.start-tabs button[aria-selected="true"] {
  background: #173b2c; color: #fff; font-weight: 650;
  box-shadow: 0 2px 6px rgb(16 42 30 / .16);
}
.start-switcher:not(.is-ready) .start-panel + .start-panel {
  margin-top: 44px; padding-top: 36px;
  border-top: 1px solid color-mix(in srgb, var(--ink-primary) 12%, transparent);
}
.start-switcher .start-method-label {
  display: inline-block; margin: 0 auto 4px; padding: 4px 14px; border-radius: 999px;
  background: #d5ebdf; color: #1c4733; font-size: 14px; font-weight: 650;
}
.start-switcher.is-ready .start-method-label,
.start-switcher.is-ready .home-noscript-npm { display: none; }
.home-steps { --step-gap: clamp(20px,3vw,45px); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--step-gap); margin: 34px 0 28px; padding: 0; list-style: none; text-align: center; }
.home-steps li { position: relative; display: grid; align-content: start; justify-items: center; gap: 12px; }
/* 横线从本列编号右侧连到下一列编号左侧，两端各留 6px。 */
.home-steps li:not(:last-child)::after { content: ''; position: absolute; inset: 14.5px calc(21px - 50% - var(--step-gap)) auto calc(50% + 21px); height: 1px; background: #a9cbb7; transform-origin: left; }
.step-index { flex: none; display: grid; place-items: center; width: 30px; height: 30px; background: #d5ebdf; color: #224e38; font-weight: 650; border-radius: 50%; font-variant-numeric: tabular-nums; }
.home-steps h3 { font-size: 20px; }
.home-start .home-steps p { margin: 6px auto 0; font-size: 16px; text-wrap: pretty; }
.home-steps code { padding: .12em .42em; border-radius: 5px; background: #daeae0; color: #164430; font-size: .9em; }
.home-steps code[data-pkg-code] { user-select: all; font-weight: 600; }
.home-copy-pkg { border: 0; font-size: 16px; }
.home-copy-pkg > span:not([data-copy-label]) { display: inline-flex; align-items: center; }
.home-copy-pkg .site-icon { vertical-align: 0; }
.home-copy-pkg.is-copied { background: #0c7a51; color: #fff; }
.home-start .storage-note { max-width: none; margin: 26px auto 0; font-size: 15px; }
.storage-note code { padding: .1em .42em; margin-inline: .08em; border-radius: 5px; background: #dcece2; color: #184732; font-size: .9em; }
.storage-note a { white-space: nowrap; }
html[data-theme="dark"] .start-tabs { background: #132221; border-color: #35544d; }
html[data-theme="dark"] .start-tabs button { color: #b7d8cb; }
html[data-theme="dark"] .start-tabs button:hover:not([aria-selected="true"]) { color: #edf6f2; background: rgb(183 216 203 / .08); }
html[data-theme="dark"] .start-tabs button[aria-selected="true"] { background: #82e3b9; color: #102a20; box-shadow: 0 2px 8px rgb(5 14 12 / .36); }
html[data-theme="dark"] .start-switcher .start-method-label { background: #26433a; color: #c5e9d4; }
html[data-theme="dark"] .step-index { color: #c5e9d4; background: #2c493e; }
html[data-theme="dark"] .home-steps code,
html[data-theme="dark"] .storage-note code { background: #233e3a; color: #c4f0da; }
html[data-theme="dark"] .home-start .site-secondary { background: #142423; border-color: #3d6159; color: #e6f4ee; }
html[data-theme="dark"] .home-start .site-secondary:hover { background: #1c312f; border-color: #5ca08d; }
html[data-theme="dark"] .home-copy-pkg.is-copied { background: #64dcb0; color: #0f2c21; }
html[data-theme="dark"] .home-steps li:not(:last-child)::after { background: #486a59; }

@media (max-width: 760px) {
  .home-steps { grid-template-columns: 1fr; max-width: 32rem; margin: 27px auto 24px; text-align: start; }
  .home-steps li { grid-template-columns: auto minmax(0, 1fr); justify-items: start; }
  .home-steps .step-index { margin-top: -2px; }
  .home-steps li:not(:last-child)::after { inset: 34px auto calc(8px - var(--step-gap)) 14.5px; width: 1px; height: auto; transform-origin: top; }
}

/* 截图在卡片底边内就位。标号之间的连线沿真实步骤方向铺开。 */
@media screen and (prefers-reduced-motion: no-preference) {
  .start-tabs button { transition: background-color 160ms ease-out, color 160ms ease-out, box-shadow 160ms ease-out; }
  .home-motion .home-feature[data-reveal] { --entry-rise: 12px; }
  .home-motion .home-feature.is-revealed .feature-image { animation: seat-screenshot 590ms cubic-bezier(.16,1,.3,1) var(--entry-delay) backwards; }
  .feature-image img, .inline-action .site-icon { transition: transform 240ms ease-out; }
  .home-motion .home-steps li[data-reveal] { --entry-rise: 8px; }
  .home-motion .start-switcher:not(.has-switched) .home-steps li.is-revealed::after { animation: connect-steps 460ms cubic-bezier(.2,.8,.25,1) var(--entry-delay) backwards; }
  .home-motion .home-actions[data-reveal], .home-motion .site-footer-inner[data-reveal] { --entry-rise: 7px; }
  @keyframes seat-screenshot { from { transform: translateY(22px); } }
  @keyframes connect-steps { from { scale: var(--line-start, 0 1); } }
}
@media screen and (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  .home-motion .home-steps li:nth-child(2), .home-motion .home-feature:nth-child(even) { --entry-delay: 65ms; }
  .home-motion .home-steps li:nth-child(3) { --entry-delay: 130ms; }
}
@media (max-width: 760px) { .home-steps { --line-start: 1 0; } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .feature-image:hover img { transform: scale(1.025); }
  .inline-action:hover .site-icon { transform: translateX(3px); }
}
/* 原生 details 保留无脚本的展开语义。支持内在尺寸插值的浏览器可从中途反向。 */
@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  @media (prefers-reduced-motion: no-preference) {
    .fg-notes::details-content {
      interpolate-size: allow-keywords;
      block-size: 0;
      overflow: clip;
      opacity: 0;
      transition: block-size 300ms cubic-bezier(.2,.75,.25,1), opacity 180ms ease-out, content-visibility 300ms allow-discrete;
    }
    .fg-notes[open]::details-content { block-size: auto; opacity: 1; }
  }
}
@media (max-width: 600px) {
  .home-features { grid-template-columns: 1fr; }
  .home-title-row { align-items: start; }
}
