/* 互动小机器：the list (/machines) and the notes under each figure (/machines/<slug>). The
   colours and shapes are the site's (public/styles.css); the figure keeps the look core.js gives it. */
:root {
  --site-paper: #faf9f5;
  --site-ink: #3e394b;
  --site-muted: #797482;
  --site-purple: #8872a4;
  --site-purple-dark: #70578e;
  --site-line: #e8e4e9;
  --site-lavender: #eee8f5;
  --site-mint: #e7eee7;
  --site-peach: #f6e9de;
}
.machine-hub,
.machine-notes,
.machine-credit {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  color: var(--site-ink);
  -webkit-font-smoothing: antialiased;
}
.machine-hub {
  margin: 0;
  background: var(--site-paper);
  font-size: 16px;
  line-height: 1.7;
}
.machine-hub main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 8px;
}
.machine-hub h1 {
  margin: 8px 0 4px;
  font-size: 30px;
}
.machine-intro {
  margin: 0 0 20px;
  color: var(--site-muted);
}
.machine-back,
.machine-actions a {
  color: var(--site-purple-dark);
  text-decoration: none;
}
.machine-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 40vw), 1fr));
  gap: 12px;
}
.machine-list li {
  display: flex;
}
.machine-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 14px;
  border: 1px solid var(--site-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 35px #49365809;
  color: inherit;
  text-decoration: none;
}
a.machine-card:hover {
  border-color: var(--site-purple);
}
.machine-card img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: var(--site-lavender);
  margin-bottom: 6px;
}
.machine-card strong {
  font-size: 18px;
}
.machine-card.soon {
  background: var(--site-mint);
  border-style: dashed;
}
.machine-card.soon .machine-line {
  color: var(--site-purple-dark);
  font-weight: 600;
}
.machine-fig {
  color: var(--site-muted);
  font-size: 13px;
}
.machine-line {
  color: var(--site-muted);
  font-size: 14px;
}

/* Under the figure: core.js lays the body out as a centred column 760px wide. */
.machine-notes {
  width: 100%;
  max-width: 760px;
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--site-paper);
  border: 1px solid var(--site-line);
  font-size: 16px;
  line-height: 1.8;
}
.machine-notes h1 {
  margin: 0 0 4px;
  font-size: 24px;
}
.machine-notes h2 {
  margin: 14px 0 4px;
  font-size: 18px;
  color: var(--site-purple-dark);
}
.machine-notes p {
  margin: 0;
}
.machine-buttons {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
}
.machine-buttons dt {
  font-weight: 700;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--site-lavender);
  justify-self: start;
}
.machine-buttons dd {
  margin: 0;
}
.machine-tip {
  margin-top: 12px !important;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--site-peach);
}
.machine-actions {
  margin-top: 14px !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.machine-actions button {
  font: inherit;
  min-height: 44px;
  padding: 6px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--site-purple);
  color: #fff;
  cursor: pointer;
}
.machine-credit {
  width: 100%;
  max-width: 760px;
  margin: 16px auto 24px;
  padding: 0 16px;
  text-align: center;
  font-size: 13px;
  color: var(--site-muted);
}
.machine-credit a {
  color: inherit;
}
@media (max-width: 560px) {
  .machine-buttons {
    grid-template-columns: 1fr;
  }
  .machine-notes {
    padding: 14px;
  }
}

/* The figures of the gallery's other engine (engine/glow/) keep the page the gallery puts around
   them: the notes and the credit sit in its 760px column, and its colour heading is in Chinese. */
:root[data-embed] .machine-notes,
:root[data-embed] .machine-credit {
  box-sizing: border-box;
  max-width: 760px;
  margin-inline: auto;
}
:root[data-embed] .ctrlrow .sw-slot::before {
  content: '颜色';
}
/* A figure whose own labels shrink with it (items `ownTags`): the shared labels replace them. */
:root.machine-own-tags #stage [class*='-tag'] {
  display: none;
}
/* The glow styles put " — " before the name (style-3.css:6); engine/title.mjs writes the whole
   title in #fignum and leaves the name empty. */
:root[data-embed] figure > .cap:first-child #figname:empty::before {
  content: none;
}
/* page-v2.mjs pages (batch D, data-embed="v2"): the part labels are labels.mjs's (13px on the
   screen) and the figure's own labels, drawn in figure units, are hidden. The picture keeps the
   shape of its viewBox, which grows by a strip when the labels need one. */
:root[data-embed='v2'] #stage [class*='-tag'] {
  display: none;
}
:root[data-embed='v2'] #stageHolder {
  aspect-ratio: auto;
}
:root[data-embed='v2'] #stage {
  height: auto;
}
:root[data-embed='v2'] #stage .tag rect,
:root[data-embed='v2'] #stage .tag path {
  vector-effect: none;
}
