/* Foundations: UI colors do not alter the scientific scene. */

:root {
  color-scheme: light;
  --ink: #17191d;
  --secondary: #6f747d;
  --line: #e6e8ec;
  --canvas: #fff;
  --stage: #f5f6f8;
  --ease: cubic-bezier(.2,.7,.2,1);
  --gallery-width: 1352px;
  --gallery-gutter: clamp(20px,4.2vw,64px);
  --detail-gutter: 32px;
  --resource-surface: #fafbfc;
  --resource-text: #2c333b;
  --resource-muted: #616a76;
  --syntax-keyword: #0550ae;
  --syntax-string: #116329;
  --syntax-number: #953800;
  --syntax-comment: #69717c;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Arial,"PingFang SC","Hiragino Sans GB",sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,input,select,textarea,summary {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
  opacity: .5;
}

button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible, summary:focus-visible,a:focus-visible {
  outline: 3px solid #6a8cce;
  outline-offset: 3px;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.5px;
}

.quiet-button,.main-button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 11px 15px;
  font-size: 13px;
  line-height: 1.2;
  transition: background-color 120ms var(--ease);
}

.quiet-button:hover {
  background: #f2f3f5;
}

.main-button {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.main-button:hover {
  background: #343841;
}

/* Gallery: retain the established paper surfaces and browsing layout. */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 76px;
  border-bottom: 1px solid var(--line);
  padding-inline: max(var(--gallery-gutter),calc((100vw - var(--gallery-width))/2));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 500;
  white-space: nowrap;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.brand-slash {
  color: #9ca1aa;
  font-weight: 400;
}

/* Account entry and login share the gallery's typography and paper surfaces. */

.brand-link {
  text-decoration: none;
}

.account-area {
  position: relative;
  font-size: 13px;
}

.account-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.account-login:hover,.account-toggle:hover {
  background: var(--stage);
}

.account-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px;
  border-radius: 8px;
  list-style: none;
  cursor: pointer;
}

.account-toggle::-webkit-details-marker {
  display: none;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--stage);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}

.account-popover {
  position: absolute;
  z-index: 10;
  right: 0;
  top: calc(100% + 10px);
  width: 260px;
  max-width: calc(100vw - 40px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
  box-shadow: 0 8px 24px #17191d0a;
}

.account-email {
  margin: 0 0 12px;
  color: var(--secondary);
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.account-logout {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: var(--stage);
  text-align: left;
}

.account-logout:hover {
  background: #eceef1;
}

.account-feedback {
  margin: 10px 0 0;
  color: #a63836;
  line-height: 1.6;
}

.account-feedback:empty {
  display: none;
}

.login-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  color: var(--secondary);
  text-decoration: none;
}

.login-back:hover {
  color: var(--ink);
}

.login-page main.login-layout {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  width: min(1120px,calc(100% - 2 * var(--gallery-gutter)));
  min-height: calc(100svh - 76px);
  margin: 0 auto;
  padding: clamp(40px,6vh,72px) 0;
}

.login-story {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(28px,4vw,64px) 0 12px;
}

.login-eyebrow {
  margin: 0 0 20px;
  color: var(--secondary);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .08em;
}

.login-story h2,.login-content h1 {
  font-family: "Songti SC","STSong","Noto Serif CJK SC","Source Han Serif SC","SimSun",serif;
  font-weight: 400;
  letter-spacing: -.04em;
}

.login-story h2 {
  font-size: clamp(34px,3.2vw,46px);
  line-height: 1.4;
}

.login-figure {
  width: 100%;
  margin: 26px 0 0;
}

.login-figure img {
  display: block;
  width: 100%;
  height: clamp(260px,32vh,350px);
  object-fit: contain;
}

.login-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--secondary);
  font-size: 12px;
}

.login-figure figcaption span[lang] {
  font-size: 11px;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--line);
  padding-left: clamp(36px,5vw,80px);
}

.login-content {
  width: 100%;
  max-width: 360px;
  padding-block: 36px;
}

.login-content .login-eyebrow {
  margin-bottom: 12px;
}

.login-content h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.4;
}

.login-description {
  margin: 12px 0 34px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.7;
}

.login-field + .login-field {
  margin-top: 22px;
}

.login-field label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.login-field input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #dce0e6;
  border-radius: 7px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  transition: border-color 140ms var(--ease);
}

.login-field input::placeholder {
  color: #9299a3;
  font-size: 14px;
}

.login-field input:hover {
  border-color: #abb2bd;
}

.login-field input[aria-invalid="true"] {
  border-color: #b65e58;
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 48px;
}

.password-input button {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--secondary);
}

.password-input button:hover {
  color: var(--ink);
}

.password-input svg {
  width: 20px;
  height: 20px;
}

.password-input .eye-slash {
  display: none;
}

.password-input button[aria-pressed="true"] .eye-slash {
  display: block;
}

.login-feedback {
  min-height: 20px;
  margin: 10px 0;
  color: #a63836;
  font-size: 12px;
  line-height: 1.6;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  font-size: 14px;
}

.login-submit:disabled {
  opacity: .7;
}

.login-spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid #ffffff50;
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 800ms linear infinite;
}

.login-browse {
  margin: 30px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--secondary);
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
}

.login-browse a {
  margin-left: 5px;
  color: var(--ink);
  text-decoration-color: #c7ccd2;
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .login-page main.login-layout {
    display: block;
    max-width: 420px;
    padding: 30px 0;
  }
  .login-story {
    display: none;
  }
  .login-panel {
    border: 0;
    padding: 0;
  }
  .login-content {
    max-width: 360px;
    padding-block: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-spinner { animation: none; }
}

.edition {
  color: var(--secondary);
  font-size: 12px;
}

main {
  max-width: calc(var(--gallery-width) + 2 * var(--gallery-gutter));
  margin: auto;
  padding: 46px var(--gallery-gutter) 36px;
}

.intro {
  display: block;
  max-width: 980px;
  margin: 0 auto 38px;
  text-align: center;
}

.intro h1 {
  margin: 0 0 17px;
  font-family: "Songti SC","STSong","Noto Serif CJK SC","Source Han Serif SC","SimSun",serif;
  font-size: 54px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.hero-clause {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  animation: hero-enter 680ms var(--ease) both;
}

.hero-clause + .hero-clause {
  animation-delay: 100ms;
  margin-inline-start: .12em;
}

.hero-ink {
  position: absolute;
  inset: 0;
  color: #267cac;
  background: linear-gradient(100deg,#176b9a 10%,#397cba 55%,#549798 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  pointer-events: none;
  animation: hero-ink-reveal 7s var(--ease) infinite;
  animation-delay: 500ms;
}

.hero-clause + .hero-clause .hero-ink {
  background-image: linear-gradient(100deg,#a87666 0%,#bd7452 60%,#b7543a 100%);
  animation-delay: 1200ms;
}

.hero-paused .hero-ink {
  animation-play-state: paused;
  visibility: hidden;
}

@keyframes hero-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-ink-reveal {
  0%,8% { opacity: 0; clip-path: inset(0 100% 0 0); }
  14% { opacity: 1; clip-path: inset(0 100% 0 0); }
  34%,52% { opacity: 1; clip-path: inset(0 0 0 0); }
  68%,100% { opacity: 0; clip-path: inset(0 0 0 0); }
}

.lead {
  margin: 0;
  color: #616975;
  font-size: 15px;
  line-height: 1.8;
}

.language-pair {
  white-space: nowrap;
}

.lead > span {
  display: inline-block;
}

.figure-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin-top: 0;
  border: 1px solid #dfe3e8;
  border-radius: 9px;
  background: #fff;
  padding: 4px 5px 4px 17px;
  transition: border-color 120ms var(--ease),box-shadow 120ms var(--ease);
}

.figure-search:focus-within {
  border-color: #8e99a8;
  box-shadow: 0 0 0 3px #6675860d;
}

.search-icon {
  display: block;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  color: #737c88;
}

.figure-search input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  appearance: none;
}

.figure-search input::placeholder {
  color: #89909a;
  opacity: 1;
}

.figure-search input:focus-visible {
  outline: 2px solid #8e99a8;
  outline-offset: 2px;
  border-radius: 3px;
}

.figure-search input::-webkit-search-cancel-button,
.figure-search input::-webkit-search-decoration {
  appearance: none;
}

.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #727b86;
}

.search-clear svg {
  width: 20px;
  height: 20px;
}

.search-clear:hover {
  background: #f3f5f7;
  color: var(--ink);
}

.search-submit {
  flex: 0 0 auto;
  min-width: 67px;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: #f1f3f5;
  padding: 10px 17px;
  color: #303841;
  font-size: 13px;
  line-height: 1.2;
  transition: background-color 120ms var(--ease);
}

.search-submit:hover {
  background: #e9edf1;
}

.search-examples {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 20px;
  margin-top: 7px;
}

.search-examples-label {
  color: #9197a0;
  font-size: 12px;
}

.search-example {
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 6px 0;
  color: #6b737e;
  font-size: 12px;
  line-height: 1.5;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.search-example:hover {
  color: var(--ink);
  text-decoration: underline;
}

.intro-hint {
  margin: 0;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.8;
  text-align: right;
}

.intro-hint strong {
  display: block;
  color: #3f444c;
  font-weight: 400;
}

.browse-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.task-filters {
  display: flex;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #d9dde3 transparent;
  scroll-padding-inline: 6px;
  gap: 5px;
}

.task-filter {
  flex-shrink: 0;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  padding: 9px 14px;
  color: #535963;
  font-size: 13px;
  letter-spacing: .01em;
  transition: background-color 120ms var(--ease);
}

.task-filter[aria-pressed="true"] {
  border-color: #e4e7ec;
  background: #f1f3f6;
  color: var(--ink);
}

.task-filter:hover {
  background: #f5f6f8;
}

.browse-status {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  color: #67707c;
  font-size: 12px;
  letter-spacing: .01em;
  white-space: nowrap;
}

.filter-count {
  color: inherit;
  font-size: 12px;
  white-space: nowrap;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 32px;
  scroll-margin-top: 24px;
}

.gallery:focus-visible {
  outline: 2px solid #8e99a8;
  outline-offset: 8px;
  border-radius: 3px;
}

.search-empty {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 0 72px;
  text-align: center;
}

.search-empty h2 {
  font-size: 21px;
  font-weight: 500;
}

.search-empty p {
  margin: 13px 0 25px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.search-empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.search-empty-actions button {
  min-height: 44px;
}

.figure-card {
  position: relative;
  min-width: 0;
}

.preview-surface {
  --preview-gutter: 22px;
  --preview-canvas-padding: 9px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 1.4;
  border: 1px solid #f0f2f5;
  border-radius: 20px;
  background: #f4f5f7;
  padding: var(--preview-gutter);
  transition: background-color 150ms var(--ease),border-color 150ms var(--ease);
}

.preview-surface::before,.preview-poster,.preview-surface .svg-host {
  position: absolute;
  inset: var(--preview-gutter);
  width: calc(100% - 2 * var(--preview-gutter));
  height: calc(100% - 2 * var(--preview-gutter));
  border: 1px solid transparent;
  border-radius: 5px;
  padding: var(--preview-canvas-padding);
}

.preview-surface::before {
  content: "";
  border-color: #e9ecf1;
  background: #fff;
}

.preview-poster {
  display: block;
  object-fit: contain;
  background: #fff;
  background-clip: padding-box;
  opacity: 1;
  pointer-events: none;
}

.svg-host {
  width: 100%;
  min-width: 0;
  line-height: 0;
}

.svg-host svg {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.preview-surface .svg-host {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.preview-surface .svg-host svg {
  height: 100%;
  background: transparent;
}

.figure-card[data-preview-state="building"] .preview-poster {
  opacity: .26;
}

.figure-card[data-preview-state="building"] .preview-surface .svg-host {
  opacity: 1;
}

.preview-open {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  border: 0;
  border-radius: 20px;
  background: transparent;
}

.preview-open:focus-visible {
  outline-offset: 5px;
}

.preview-open[aria-busy="true"],.figure-card[data-load-state="loading"] .preview-open {
  cursor: progress;
}

.figure-card[data-load-state="error"] .preview-open {
  cursor: pointer;
}

.figure-card:hover .preview-surface {
  border-color: #dce1e8;
  background: #eef1f5;
}

.preview-load-status {
  position: absolute;
  right: 28px;
  bottom: 30px;
  left: 28px;
  display: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.96);
  padding: 8px 12px;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  pointer-events: none;
}

.figure-card[data-load-state="error"] .preview-load-status {
  display: block;
}

.preview-step {
  position: absolute;
  right: 16px;
  bottom: 10px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #606772;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms var(--ease);
}

.preview-step span {
  white-space: nowrap;
}

.preview-track {
  flex: 1;
  height: 2px;
  overflow: hidden;
  background: #dfe2e8;
}

.preview-track i {
  display: block;
  width: 0;
  height: 100%;
  background: #8d929b;
}

.figure-card[data-preview-state="building"] .preview-step {
  opacity: 1;
}

.card-meta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 16px 2px 0;
}

.card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #f2f3f6;
  color: #252830;
}

.card-icon svg {
  width: 23px;
  height: 23px;
}

.card-copy {
  flex: 1;
  min-width: 0;
}

.card-copy h2 {
  overflow: hidden;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-subtitle {
  overflow: hidden;
  margin: 1px 0 0;
  color: #626b77;
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-open {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.card-open:hover~.card-copy h2 {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-arrow {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #78818d;
  opacity: .45;
  transition: opacity 150ms var(--ease),transform 150ms var(--ease);
}

.figure-card:hover .card-arrow,.figure-card:focus-within .card-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.data-note {
  display: block;
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 19px;
  color: #67707c;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .01em;
}

.data-note strong {
  color: #50545c;
  font-weight: 500;
  white-space: nowrap;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 1600px;
  margin: auto;
  padding: 0 4vw 25px;
  color: var(--secondary);
  font-size: 11px;
}

/* Detail workbench: full SVG paper, shared resource toolbar, separate desktop panes. */

dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 0;
  color: var(--ink);
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: #fff;
}

dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viewer-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 0 var(--detail-gutter);
}

.viewer-breadcrumb {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.viewer-breadcrumb .brand-mark {
  width: 31px;
  height: 31px;
}

.viewer-title {
  overflow: hidden;
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.close-button {
  min-height: 44px;
  border: 0;
  background: none;
  padding: 10px 0 10px 12px;
  color: #5e6570;
  font-size: 12px;
  white-space: nowrap;
}

.close-button:hover {
  color: var(--ink);
}

.viewer-body {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.viewer-left {
  overflow: auto;
  padding: 36px 36px 32px;
  overscroll-behavior: contain;
}

.viewer-overview {
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
}

.detail-intro {
  margin: 10px 0 25px;
}

.detail-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 12px;
}

.detail-meta .detail-label,.detail-meta .detail-origin {
  margin: 0;
  color: #78818c;
  font-size: 11px;
  line-height: 1.6;
}

.detail-meta .detail-origin {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.detail-label {
  margin: 0 0 7px;
  color: var(--resource-muted);
  font-size: 12px;
  line-height: 1.5;
}

.detail-title {
  margin: 0 0 9px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.7px;
}

.detail-summary {
  max-width: 62ch;
  margin: 0;
  color: #58616d;
  font-size: 14px;
  line-height: 1.7;
}

.detail-origin {
  margin: 7px 0 0;
  color: #78818c;
  font-size: 12px;
  line-height: 1.6;
}

.viewer-chart {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--stage);
  padding: 10px;
}

.viewer-chart .svg-host {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

.viewer-chart .svg-host svg {
  width: 100%;
  height: auto;
  max-height: 420px;
  background: #fff;
}

.figure-modes {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 8px;
}

.figure-mode {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 7px 12px;
  color: var(--resource-muted);
  font-size: 12px;
  white-space: nowrap;
}

.figure-mode[aria-pressed="true"],.figure-mode:hover {
  background: #fff;
  color: var(--ink);
}

.loop-label {
  margin-left: auto;
  padding-right: 3px;
  color: #7c8490;
  font-size: 11px;
  white-space: nowrap;
}

.viewer-controls {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 3px 2px;
}

.viewer-track {
  flex: 1;
  min-width: 20px;
  height: 2px;
  overflow: hidden;
  background: #dfe2e8;
}

.viewer-track i {
  display: block;
  width: 0;
  height: 100%;
  background: #8893a1;
}

.time-label {
  color: var(--resource-muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

.figure-caption-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
}

.figure-image-actions {
  display: flex;
  flex-shrink: 0;
  gap: 16px;
  align-items: center;
}

.chart-hint {
  margin: 0;
  color: var(--resource-muted);
  font-size: 12px;
  line-height: 1.6;
}

#download-image,#view-image {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  color: #414b58;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

#download-image:hover,#view-image:hover {
  text-decoration: underline;
}

.generation-panel {
  margin-top: 3px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.generation-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  font-size: 13px;
  line-height: 1.6;
}

.generation-heading h4 {
  margin: 0;
  font-size: inherit;
  font-weight: 500;
}

.generation-heading span {
  color: #77818d;
  font-size: 11px;
}

.stages {
  display: grid;
  grid-template-columns: repeat(var(--stage-count,6),minmax(0,1fr));
  gap: 6px;
}

.stage-button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #e3e7ec;
  border-radius: 7px;
  background: #fff;
  padding: 7px 8px;
  color: #66717e;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
}

.stage-button span {
  flex-shrink: 0;
  color: #929ba6;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.stage-button[aria-current="step"] {
  border-color: #afbcca;
  background: #edf2f7;
  color: #1d2c3d;
}

.stage-button[aria-current="step"] span {
  color: #526a83;
}

.stage-button:hover {
  border-color: #c2ccd7;
  background: #f5f7fa;
  color: var(--ink);
}

.stage-explanation {
  min-height: 38px;
  margin: 11px 0 0;
  color: #67717d;
  font-size: 12px;
  line-height: 1.6;
}

.viewer-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
}

.viewer-tabs {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 28px;
  min-height: 57px;
  border-bottom: 1px solid var(--line);
  padding: 0 var(--detail-gutter);
}

.viewer-tab {
  min-height: 56px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 17px 0 15px;
  color: var(--resource-muted);
  font-size: 13px;
  white-space: nowrap;
}

.viewer-tab[aria-selected="true"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
  font-weight: 500;
}

.viewer-tab:hover {
  color: var(--ink);
}

.resource-kit {
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px var(--detail-gutter) 14px;
}

.kit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px 14px;
}

.bundle-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.bundle-note {
  margin: 8px 0 0;
  color: var(--resource-muted);
  font-size: 11px;
  line-height: 1.65;
}

.content-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 25px var(--detail-gutter) 30px;
  color: var(--resource-text);
  font-size: 14px;
  line-height: 1.7;
  overscroll-behavior: contain;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #dfe4eb;
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
  color: #343e4b;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.tool-button:hover {
  border-color: #c5ced9;
  background: #f5f7fa;
}

.inline-action {
  min-height: 44px;
  border: 0;
  background: none;
  padding: 9px 0;
  color: #35475c;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

.inline-action:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Guide: each explanation connects to an actual SVG annotation. */

.guide-heading {
  margin-bottom: 16px;
}

.guide-heading h3 {
  margin: 0;
  color: #1f2731;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -.35px;
  text-wrap: balance;
}

.guide-observation {
  margin: 0 0 20px;
  color: var(--resource-muted);
  font-size: 13px;
  line-height: 1.7;
}

.guide-section {
  margin: 0 0 21px;
}

.guide-section h3,.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -.2px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.section-heading > span {
  color: #788492;
  font-size: 11px;
  line-height: 1.6;
}

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

.reading-list li {
  min-width: 0;
}

.reading-cue,.reading-static {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 14px 12px;
  color: var(--resource-text);
  text-align: left;
}

.reading-cue:hover {
  background: #f7f8fa;
}

.reading-cue[aria-pressed="true"] {
  border-color: #dce4ed;
  background: #f2f5f9;
}

.reading-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f0f3f6;
  padding: 6px;
  color: #5f6d7e;
  font-size: 20px;
  line-height: 1;
}

.reading-symbol svg {
  display: block;
  width: 21px;
  height: 21px;
}

.reading-number {
  font: 12px/1 Menlo,Consolas,monospace;
  font-variant-numeric: tabular-nums;
}

.reading-symbol i {
  display: block;
  width: 3px;
  height: 7px;
  border-radius: 2px;
}

.reading-cue[aria-pressed="true"] .reading-symbol {
  background: #e4ebf3;
  color: #3e536d;
}

.reading-copy {
  position: relative;
  flex: 1;
  min-width: 0;
}

.reading-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.reading-copy .reading-text {
  display: block;
  margin: 4px 0 0;
  color: #596370;
  font-size: 14px;
  line-height: 1.7;
}

.cue-hint {
  position: absolute;
  top: 1px;
  right: 0;
  display: block;
  margin: 0;
  color: #85909d;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 120ms var(--ease);
}

.reading-cue:hover .cue-hint,
.reading-cue:focus-visible .cue-hint,
.reading-cue[aria-pressed="true"] .cue-hint {
  opacity: 1;
}

.reading-cue[aria-pressed="true"] .cue-hint {
  color: #506781;
}

.guide-next {
  margin-top: 23px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
}

.guide-next p {
  margin: 0 0 5px;
  color: #465362;
  font-size: 13px;
  line-height: 1.7;
}

.guide-next span {
  color: #788492;
  font-size: 12px;
}

.content-details {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.content-details summary {
  min-height: 30px;
  color: #596676;
  font-size: 12px;
  line-height: 1.7;
  cursor: pointer;
}

.content-details ul {
  padding-left: 18px;
  color: var(--resource-muted);
  font-size: 12px;
  line-height: 1.8;
}

.content-details li + li {
  margin-top: 7px;
}

/* Source: readable complete files with restrained syntax colors. */

.code-choice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.code-languages {
  display: flex;
  gap: 3px;
  border-radius: 9px;
  background: #f1f3f6;
  padding: 3px;
}

.code-language {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: none;
  padding: 8px 18px;
  color: var(--resource-muted);
  font-size: 13px;
}

.code-language[aria-pressed="true"] {
  background: #fff;
  color: #1c2532;
  box-shadow: 0 1px 3px #2028300a;
}

.run-block {
  margin: 0 0 20px;
}

.run-command-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.run-command-row + .run-command-row {
  margin-top: 4px;
}

.run-block .run-label {
  margin: 0;
  color: var(--resource-muted);
  font-size: 12px;
}

.run-block code {
  color: #2c333b;
  font: 12px/1.7 Menlo,Consolas,monospace;
  overflow-wrap: anywhere;
}

.run-block p {
  margin: 8px 0 0;
  color: var(--resource-muted);
  font-size: 12px;
  line-height: 1.8;
}

.common-changes {
  margin: 0 0 18px;
  padding-top: 13px;
}

.change-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding-top: 9px;
  color: var(--resource-muted);
  font-size: 12px;
}

.change-row code {
  max-width: 65%;
  color: #566479;
  font: 11px/1.8 Menlo,Consolas,monospace;
  text-align: right;
  overflow-wrap: anywhere;
}

.change-note {
  margin: 12px 0 0;
  color: var(--resource-muted);
  font-size: 12px;
}

.source-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--resource-surface);
}

.source-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 17px;
  color: #404953;
  font: 12px/1.4 Menlo,Consolas,monospace;
}

.source-heading > span:last-child {
  color: var(--resource-muted);
  font: 11px/1.4 Arial,"PingFang SC",sans-serif;
}

.source-code {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  padding: 17px;
  color: var(--resource-text);
  font: 13px/1.75 Menlo,Consolas,"Hiragino Sans GB",monospace;
  tab-size: 4;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  overscroll-behavior-x: contain;
}

.source-code code {
  font: inherit;
  letter-spacing: 0;
  white-space: inherit;
}

.source-code:focus-visible,.table-scroll:focus-visible {
  outline-offset: -3px;
}

.syntax-code .token.comment,.syntax-code .token.prolog, .syntax-code .token.doctype,.syntax-code .token.cdata {
  color: var(--syntax-comment);
}

.syntax-code .token.keyword,.syntax-code .token.function,.syntax-code .token.builtin, .syntax-code .token.class-name,.syntax-code .token.decorator,.syntax-code .token.atrule {
  color: var(--syntax-keyword);
}

.syntax-code .token.string,.syntax-code .token.char,.syntax-code .token.attr-value {
  color: var(--syntax-string);
}

.syntax-code .token.number,.syntax-code .token.boolean {
  color: var(--syntax-number);
}

.syntax-code .token.operator,.syntax-code .token.punctuation {
  color: #4b535d;
}

.syntax-code .token.important {
  font-weight: 600;
}

/* Data: mapping fields to marks precedes a faithful CSV preview. */

.data-intro {
  margin: 0 0 18px;
}

.data-intro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.data-intro-row .inspect-action {
  flex-shrink: 0;
  margin: 0;
  font-size: 12px;
}

.data-intro p {
  margin: 0 0 6px;
  color: #262c34;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
}

.data-intro > span {
  color: var(--resource-muted);
  font-size: 12px;
  line-height: 1.7;
}

.field-map {
  display: grid;
  gap: 0;
  margin: 18px 0 20px;
  border-top: 1px solid var(--line);
}

.field-cue {
  display: grid;
  grid-template-columns: minmax(140px,1.2fr) 18px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px 8px;
  color: #566372;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

.field-cue code {
  color: #354152;
  font: 12px/1.6 Menlo,Consolas,monospace;
  overflow-wrap: anywhere;
}

.field-cue > span:first-of-type {
  color: #97a1ae;
  text-align: center;
}

.field-cue:hover {
  background: #f7f9fb;
}

.field-cue[aria-pressed="true"] {
  background: #edf3f9;
  color: #344f6d;
}

.inspect-action {
  display: block;
  margin: 0 0 17px;
  font-size: 13px;
}

.data-file {
  border-top: 1px solid var(--line);
  padding: 24px 0 27px;
}

.data-file:first-child {
  border: 0;
  padding-top: 0;
}

.file-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.file-identity {
  flex: 1;
  min-width: 0;
}

.file-heading h3 {
  margin: 0 0 4px;
  color: #252b33;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.file-path {
  display: block;
  overflow: hidden;
  color: var(--resource-muted);
  font: 12px/1.6 Menlo,Consolas,monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-heading .tool-button {
  flex-shrink: 0;
  font-size: 12px;
  white-space: nowrap;
}

.file-description {
  margin: 12px 0 16px;
  color: var(--resource-muted);
  font-size: 13px;
  line-height: 1.8;
}

.preview-caption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 9px;
  color: var(--resource-muted);
  font-size: 11px;
  line-height: 1.7;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  overscroll-behavior-x: contain;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: #3d4652;
  font: 12px/1.65 Menlo,Consolas,monospace;
  white-space: nowrap;
}

.data-table th,.data-table td {
  border: 0;
  border-bottom: 1px solid #eceef1;
  padding: 11px 13px;
  font-weight: 400;
  text-align: left;
}

.data-table th {
  background: #f7f8fa;
  padding-top: 12px;
  padding-bottom: 10px;
}

.data-table th > span {
  display: block;
  color: #343d49;
  font: 500 12px/1.5 Arial,"PingFang SC",sans-serif;
}

.data-table th > code {
  display: block;
  margin-top: 3px;
  color: var(--resource-muted);
  font: 10px/1.6 Menlo,Consolas,monospace;
}

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

.data-table .numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.data-table tbody tr:hover {
  background: #fafbfc;
}

.data-point-link {
  min-height: 30px;
  border: 0;
  background: none;
  padding: 2px 0;
  color: #425e7c;
  font: inherit;
  text-align: left;
}

.data-point-link:hover {
  text-decoration: underline;
}

.color-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border: 1px solid #00000012;
  border-radius: 2px;
  vertical-align: -1px;
}

.data-notes {
  margin: 12px 0 0;
  padding: 0;
  color: var(--resource-muted);
  font-size: 12px;
  line-height: 1.8;
  list-style: none;
}

.data-notes li + li {
  margin-top: 5px;
}

.field-guide {
  margin-top: 14px;
  border: 0;
  padding: 0;
}

.field-guide .schema-list {
  margin-top: 12px;
}

.schema-list {
  margin: 0;
}

.schema-row {
  display: grid;
  grid-template-columns: minmax(120px,160px) minmax(0,1fr);
  gap: 12px;
  border-top: 1px solid #edf0f4;
  padding: 12px 0;
  font-size: 12px;
  line-height: 1.75;
}

.schema-row dt {
  color: #384450;
  font: 11px/1.75 Menlo,Consolas,monospace;
  overflow-wrap: anywhere;
}

.schema-row dd {
  margin: 0;
  color: var(--resource-muted);
}

.field-badge {
  display: block;
  width: fit-content;
  margin-top: 5px;
  border-radius: 4px;
  background: #f1f3f6;
  padding: 2px 5px;
  color: #788391;
  font: 10px/1.5 Arial,"PingFang SC",sans-serif;
  white-space: nowrap;
}

.field-badge.is-used {
  background: #edf2f8;
  color: #4c6480;
}

/* Point inspector: one selected SVG element, its CSV row and drawing rules. */

.point-inspector {
  margin-bottom: 23px;
  border: 1px solid #e4e9f0;
  border-radius: 10px;
  background: #f7f9fb;
  padding: 17px;
}

.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.inspector-head > span {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.inspector-head button {
  font-size: 12px;
}

.point-label {
  display: block;
  margin: 0 0 7px;
  color: var(--resource-muted);
  font-size: 12px;
  line-height: 1.6;
}

.point-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d9dfe8;
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  color: #303640;
  font: 12px Menlo,Consolas,monospace;
}

.example-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 17px;
}

.example-point {
  min-height: 44px;
  border: 1px solid #e1e6ed;
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
  color: #5a697b;
  font-size: 12px;
}

.example-point[aria-pressed="true"] {
  border-color: #aebccd;
  background: #ebf1f7;
  color: #26384e;
}

.point-title {
  margin: 0;
  font: 600 17px/1.4 Menlo,Consolas,monospace;
  letter-spacing: -.5px;
}

.point-origin {
  margin: 5px 0 15px;
  color: var(--resource-muted);
  font-size: 11px;
  line-height: 1.7;
}

.point-values {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
  font-size: 13px;
  line-height: 1.6;
}

.point-values dt {
  color: var(--resource-muted);
}

.point-values dd {
  margin: 0;
  color: #313741;
  font-family: Menlo,Consolas,monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mapping-block {
  padding-top: 14px;
}

.mapping-label {
  margin: 0 0 6px;
  color: var(--resource-muted);
  font-size: 12px;
}

.mapping-value {
  margin: 0;
  color: #343b46;
  font-size: 13px;
  line-height: 1.8;
}

.mapping-value code {
  font-size: 12px;
}

.rule-outcome {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 13px;
}

.point-key {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.rule-note {
  margin: 6px 0 0;
  color: var(--resource-muted);
  font-size: 12px;
  line-height: 1.8;
}

.code-details {
  margin-top: 14px;
}

.code-details summary {
  min-height: 30px;
  color: #5c6878;
  font-size: 12px;
  line-height: 1.7;
  cursor: pointer;
}

.code-details pre {
  max-height: 250px;
  overflow: auto;
  border-radius: 8px;
  background: #f0f3f7;
  padding: 12px;
  color: #505968;
  font: 12px/1.75 Menlo,Consolas,monospace;
}

#point-code {
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

.code-location {
  display: block;
  margin-top: 9px;
  color: #6d7785;
  font: 10px/1.7 Menlo,Consolas,monospace;
}

.point-selection-halo,.figure-cue-overlay {
  pointer-events: none;
}

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

/* Responsive: on mobile the viewer body is the only vertical scroller. */

@media (max-width:1100px) {
  :root {
    --detail-gutter: 24px;
  }
  .gallery {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 30px 24px;
  }
  .intro h1 {
    font-size: 46px;
  }
  .preview-surface {
    --preview-gutter: 20px;
    aspect-ratio: 1.4;
  }
  .viewer-tabs {
    gap: 24px;
  }
  .viewer-left {
    padding-inline: var(--detail-gutter);
  }
  .stages {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .reading-cue,.reading-static {
    gap: 11px;
    padding-inline: 9px;
  }
  .reading-symbol {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
    padding: 5px;
  }
  .field-cue {
    grid-template-columns: minmax(125px,1.2fr) 15px minmax(0,1fr);
  }
  .schema-row {
    grid-template-columns: 125px minmax(0,1fr);
  }
}

@media (max-width:1050px) {
  .intro-hint {
    display: none;
  }
}

@media (max-width:1060px) {
  .viewer-body {
    display: block;
    overflow: auto;
  }
  .viewer-left {
    overflow: visible;
    padding-top: 22px;
  }
  .viewer-sidebar {
    overflow: visible;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .viewer-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
  }
  .content-scroll {
    overflow: visible;
  }
  .viewer-tabs,.resource-kit,.content-scroll {
    padding-inline: max(var(--detail-gutter),calc((100% - 680px) / 2));
  }
  .stages {
    grid-template-columns: repeat(var(--stage-count,6),minmax(0,1fr));
  }
}

@media (max-width:820px) {
  .edition {
    display: none;
  }
  .footer {
    flex-wrap: wrap;
  }
}

@media (pointer:coarse) {
  .figure-mode {
    min-height: 44px;
  }
}

@media (max-width:640px) {
  .masthead {
    height: 68px;
  }
  .masthead .brand {
    gap: 10px;
    font-size: 20px;
  }
  .masthead .brand-mark {
    width: 32px;
    height: 32px;
  }
  main {
    padding-top: 30px;
    padding-bottom: 28px;
  }
  .intro {
    margin-bottom: 26px;
  }
  .intro h1 {
    margin-bottom: 13px;
    font-size: 30px;
    letter-spacing: -.02em;
  }
  .lead {
    max-width: 34em;
    font-size: 13px;
    text-wrap: balance;
  }
  .figure-search {
    gap: 8px;
    margin-top: 20px;
    padding-left: 13px;
  }
  .figure-search input {
    font-size: 16px;
  }
  .search-submit {
    min-width: 57px;
    padding-inline: 12px;
    font-size: 12px;
  }
  .search-examples {
    gap: 0 16px;
    margin-top: 4px;
  }
  .browse-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 18px;
  }
  .task-filters {
    width: 100%;
    gap: 3px;
    padding-bottom: 4px;
  }
  .task-filter {
    min-height: 44px;
    padding: 9px 11px;
    font-size: 12px;
  }
  .filter-count {
    display: inline;
    font-size: 11px;
  }
  .browse-status {
    gap: 10px;
    font-size: 11px;
  }
  .gallery {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .search-empty {
    padding-top: 42px;
    padding-bottom: 46px;
  }
  .search-empty h2 {
    font-size: 19px;
  }
  .search-empty p {
    font-size: 13px;
  }
  .preview-surface {
    --preview-gutter: 16px;
    --preview-canvas-padding: 7px;
    aspect-ratio: 1.35;
    border-radius: 18px;
  }
  .card-meta {
    padding-top: 13px;
  }
  .card-copy h2 {
    font-size: 19px;
  }
  .card-subtitle {
    font-size: 13px;
  }
  .card-arrow {
    opacity: .65;
  }
  .data-note {
    margin-top: 28px;
    padding-top: 17px;
    font-size: 11px;
  }
  .stages {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media (max-width:480px) {
  :root {
    --detail-gutter: 20px;
  }
  .data-note strong {
    display: block;
  }
  .footer {
    padding: 0 20px 20px;
  }
  .viewer-head {
    gap: 9px;
  }
  .viewer-breadcrumb {
    gap: 9px;
  }
  .viewer-breadcrumb .brand-mark {
    width: 28px;
    height: 28px;
  }
  .viewer-title {
    font-size: 15px;
  }
  .close-button {
    padding-left: 4px;
    font-size: 11px;
  }
  .viewer-left {
    padding-top: 20px;
    padding-bottom: 24px;
  }
  .detail-title {
    font-size: 26px;
  }
  .detail-summary {
    font-size: 13px;
  }
  .detail-origin {
    font-size: 11px;
  }
  .viewer-chart {
    border-radius: 11px;
    padding: 7px;
  }
  .figure-mode {
    padding: 9px 10px;
    font-size: 11px;
  }
  .loop-label,.time-label {
    font-size: 10px;
  }
  .viewer-controls {
    gap: 7px;
  }
  .figure-caption-row {
    align-items: flex-start;
    gap: 10px;
    padding-top: 7px;
  }
  .chart-hint {
    padding-block: 6px;
    font-size: 11px;
  }
  #download-image,#view-image {
    font-size: 11px;
  }
  .generation-heading {
    align-items: flex-start;
  }
  .generation-heading span {
    max-width: 14em;
    text-align: right;
  }
  .viewer-tabs {
    gap: 24px;
  }
  .viewer-tab {
    font-size: 12px;
  }
  .content-scroll {
    padding-top: 23px;
  }
  .guide-heading h3 {
    font-size: 19px;
  }
  .reading-cue,.reading-static {
    gap: 11px;
    padding: 12px 8px;
  }
  .reading-copy .reading-text {
    font-size: 13px;
  }
  .code-choice-row {
    gap: 10px;
  }
  .code-language {
    padding-inline: 17px;
    font-size: 12px;
  }
  .run-command-row {
    display: block;
  }
  .run-block .run-label {
    display: block;
    margin-bottom: 5px;
  }
  .run-block code {
    font-size: 11px;
  }
  .source-code {
    padding: 14px;
    font-size: 12px;
    line-height: 1.75;
  }
  .source-heading {
    padding: 12px 14px;
  }
  .data-intro p {
    font-size: 16px;
  }
  .field-cue {
    grid-template-columns: minmax(130px,1.2fr) 14px minmax(0,1fr);
    gap: 6px;
  }
  .field-cue code {
    font-size: 11px;
  }
  .file-path {
    font-size: 11px;
  }
  .file-heading .tool-button {
    padding-inline: 10px;
    font-size: 11px;
  }
  .file-description {
    font-size: 12px;
  }
  .data-table th,.data-table td {
    padding-inline: 11px;
  }
  .schema-row {
    grid-template-columns: 118px minmax(0,1fr);
    gap: 10px;
  }
  .point-inspector {
    padding: 14px;
  }
  .point-values {
    font-size: 12px;
  }
  .mapping-value,.rule-outcome {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .hero-clause {
    animation: none;
  }
  .hero-ink {
    display: none;
  }
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
  dialog::backdrop {
    backdrop-filter: none;
  }
  .figure-card[data-preview-state="building"] .preview-poster {
    opacity: 1;
  }
  .figure-card[data-preview-state="building"] .preview-surface .svg-host,
  .figure-card[data-preview-state="building"] .preview-step {
    opacity: 0;
  }
}

@media (forced-colors:active),print {
  .hero-clause { animation: none; }
  .hero-ink { display: none; }
}

/* 选图入口与需求问卷。 */
.visually-hidden,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 26px;
}

.hero-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  min-height: 48px;
  padding: 12px 21px;
  border-radius: 9px;
  font-size: 15px;
}

.hero-action-note {
  margin: 13px 0 0;
  color: #626975;
  font-size: 12px;
  line-height: 1.8;
}

.intro {
  padding-block: 10px 0;
  margin-bottom: 46px;
}

.library-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-bottom: 12px;
}

.library-heading h2 {
  margin: 0;
  padding-top: 11px;
  font-size: 22px;
  font-weight: 500;
}

.library-search {
  width: min(50%,580px);
}

.library-search .figure-search {
  min-height: 48px;
}

.library-search .figure-search input {
  height: 38px;
  font-size: 13px;
}

.library-search .search-submit {
  min-height: 38px;
  min-width: 62px;
}

.library-search .search-examples {
  justify-content: flex-start;
  gap: 0 16px;
  margin-top: 5px;
  padding-left: 2px;
}

.library-search .search-example {
  min-height: 40px;
}

.search-scope {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 0 20px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fa;
}

.search-scope p {
  margin: 0;
  color: #626975;
  font-size: 13px;
  line-height: 1.7;
}

.search-scope .inline-action {
  flex: 0 0 auto;
  min-height: 44px;
  font-size: 13px;
}

/* Guided selection: compact steps, semantic marks and one visible decision. */

.selection-panel {
  max-width: 1120px;
  margin: -16px auto 32px;
}

.selection-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  color: #626975;
  font-size: 12px;
}

.selection-topbar .inline-action {
  min-height: 44px;
  color: #626975;
  font-size: 13px;
}

.selection-workspace {
  display: grid;
  grid-template-columns: minmax(0,1fr) 240px;
  gap: 36px;
  padding-top: 28px;
}

.selection-main {
  min-width: 0;
}

.selection-stage-track {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 28px;
  padding: 0;
  color: #6b737e;
  font-size: 11px;
  line-height: 1.5;
}

.selection-stage {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.selection-stage + .selection-stage::before {
  content: "";
  width: clamp(16px,2.3vw,28px);
  height: 1px;
  margin-inline: 11px;
  background: #e6e8ec;
}

.selection-stage-marker {
  display: grid;
  place-items: center;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  border: 1px solid #e1e3e7;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.selection-stage-label {
  white-space: nowrap;
}

.selection-stage.is-current {
  color: var(--ink);
  font-weight: 500;
}

.selection-stage.is-current .selection-stage-marker {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.selection-stage.is-complete {
  color: #555b64;
}

.selection-stage.is-complete .selection-stage-marker {
  border-color: #d3d6dc;
  background: #f3f4f6;
  color: #383e47;
}

#selection-question,
#selection-confirmation {
  animation: selection-enter 160ms var(--ease) both;
}

@keyframes selection-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.selection-question-kicker {
  margin: 0 0 8px;
  color: #626975;
  font-size: 12px;
}

.selection-question-heading,
.selection-review-header h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.selection-question-heading:focus {
  outline: none;
}

.selection-question-help,
.selection-review-header p {
  margin: 12px 0 24px;
  color: #626975;
  font-size: 13px;
  line-height: 1.8;
}

.selection-fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.selection-choices {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}

.selection-choices[data-question="goal"] {
  grid-template-columns: repeat(3,minmax(0,1fr));
}

.selection-choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  min-height: 98px;
  border: 1px solid #e2e4e8;
  border-radius: 14px;
  background: #fff;
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color 140ms var(--ease),background-color 140ms var(--ease);
}

.selection-choice:hover {
  border-color: #a4a9b1;
  background: #fcfcfd;
}

.selection-choice.is-selected {
  border-color: var(--ink);
  background: #f6f7f8;
}

.selection-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.selection-choice:has(input:focus-visible) {
  outline: 3px solid #6a8cce;
  outline-offset: 3px;
}

.selection-choice-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 36px;
  margin-top: 2px;
  color: #4f5865;
  pointer-events: none;
}

.selection-choice-visual svg {
  display: block;
  width: 48px;
  height: 36px;
  overflow: visible;
}

.selection-choice.is-selected .selection-choice-visual {
  color: #252a31;
}

.selection-choice-indicator {
  position: absolute;
  top: 16px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #cbd0d7;
  border-radius: 50%;
  background: #fff;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
}

.selection-choice:has(input[type="checkbox"]) .selection-choice-indicator {
  border-radius: 4px;
}

.selection-choice.is-selected .selection-choice-indicator {
  border-color: var(--ink);
  background: var(--ink);
}

.selection-choice-copy {
  min-width: 0;
  flex: 1;
}

.selection-choice-title {
  display: block;
  padding-right: 18px;
  color: #252a31;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
}

.selection-choice-help {
  display: block;
  margin-top: 5px;
  color: #68717d;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.selection-choices[data-question="goal"] .selection-choice {
  min-height: 122px;
  padding: 17px 14px;
}

.selection-choices[data-question="goal"] .selection-choice[data-value="unknown"],
.selection-choice[data-value="unknown"] {
  grid-column: 1/-1;
  align-items: center;
  min-height: 56px;
  border-color: #e8eaed;
  background: #fafbfc;
  padding-block: 12px;
}

.selection-choice[data-value="unknown"] .selection-choice-visual {
  flex-basis: 24px;
  width: 24px;
  height: 24px;
  margin: 0;
}

.selection-choice[data-value="unknown"] .selection-choice-visual svg {
  width: 24px;
  height: 24px;
}

.selection-choice[data-value="unknown"] .selection-choice-copy {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.selection-choice[data-value="unknown"] .selection-choice-title {
  flex-shrink: 0;
  padding-right: 0;
}

.selection-choice[data-value="unknown"] .selection-choice-help {
  margin: 0 20px 0 0;
}

.selection-choice[data-value="unknown"].is-selected {
  border-color: var(--ink);
  background: #f6f7f8;
}

.selection-error {
  min-height: 18px;
  margin: 12px 0 8px;
  color: #9b463a;
  font-size: 12px;
  line-height: 1.6;
}

.selection-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.selection-navigation .main-button {
  min-width: 126px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 13px;
}

.selection-back {
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 10px 0;
  color: #68707b;
  font-size: 13px;
}

.selection-back:hover {
  color: var(--ink);
}

.selection-summary {
  align-self: start;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 4px 0 0 24px;
}

.selection-summary-head {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.selection-summary-head svg,
.selection-summary-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  color: #555e6b;
}

.selection-summary-label {
  display: block;
  margin: 0 0 8px;
  color: #6b737e;
  font-size: 11px;
  line-height: 1.6;
}

.selection-summary-count {
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid #e6e8ec;
  border-radius: 5px;
  padding: 2px 6px;
  color: #6b737e;
  font-size: 10px;
  line-height: 1.6;
}

.selection-summary-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
}

.selection-summary-empty {
  margin: 0;
  color: #6b737e;
  font-size: 12px;
  line-height: 1.85;
}

.selection-summary-list {
  margin: 0;
}

.selection-summary-item {
  padding: 13px 0;
  border-bottom: 1px solid #eff0f3;
}

.selection-summary-item:first-child {
  padding-top: 0;
}

.selection-summary-item:last-child {
  border-bottom: 0;
}

.selection-summary-item dt {
  color: #6b737e;
  font-size: 11px;
  line-height: 1.6;
}

.selection-summary-item dd {
  margin: 5px 0 0;
  color: #404854;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.selection-review-list {
  margin: 0 0 24px;
  border-top: 1px solid var(--line);
}

.selection-review-item {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: 14px 56px 14px 0;
}

.selection-review-label {
  display: block;
  margin-bottom: 5px;
  color: #6b737e;
  font-size: 11px;
  line-height: 1.6;
}

.selection-review-answer {
  margin: 0;
  color: #343d47;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.selection-review-edit {
  position: absolute;
  top: 10px;
  right: 0;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 10px 0 10px 14px;
  color: #626975;
  font-size: 12px;
}

.selection-review-edit:hover {
  color: var(--ink);
  text-decoration: underline;
}

.selection-optional {
  margin: 0 0 24px;
}

.selection-optional-heading {
  margin: 0;
  color: #343d47;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.selection-optional .selection-question-help {
  margin: 7px 0 12px;
  font-size: 12px;
}

.selection-focus-options {
  gap: 8px;
}

.selection-focus-options .selection-choice {
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 10px;
  padding: 11px 13px;
}

.selection-focus-options .selection-choice-title {
  font-size: 13px;
}

.selection-focus-options .selection-choice[data-value="unknown"],
.selection-focus-options .selection-choice[data-value="no-preference"] {
  grid-column: auto;
}

.selection-notes-label {
  display: block;
  margin-bottom: 9px;
  color: #5f6874;
  font-size: 13px;
}

.selection-notes {
  display: block;
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.selection-notes::placeholder {
  color: #6b737e;
}

.selection-notes-hint {
  margin: 7px 0 0;
  color: #6b737e;
  font-size: 11px;
  line-height: 1.6;
}

/* Submitted answers remain available without competing with the live status. */

.selection-pending {
  max-width: 800px;
  margin: 0 auto;
  padding: 44px 0 16px;
}

.selection-pending-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.selection-pending-loader {
  display: block;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 2px solid #e6e8ec;
  border-top-color: #333941;
  border-radius: 50%;
  animation: selection-loading 900ms linear infinite;
}

@keyframes selection-loading {
  to { transform: rotate(360deg); }
}

.selection-pending-title {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.5;
}

.selection-pending-copy {
  margin: 7px 0 0;
  color: #6b737e;
  font-size: 13px;
  line-height: 1.8;
}

.selection-pending-details {
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.selection-pending-details > summary {
  min-height: 44px;
  padding: 13px 0;
  color: #68717d;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.selection-pending-brief {
  margin: 0;
}

.selection-pending-brief > div {
  display: grid;
  grid-template-columns: minmax(130px,.8fr) minmax(0,2fr);
  gap: 22px;
  border-top: 1px solid #eff0f3;
  padding: 13px 0;
}

.selection-pending-brief dt {
  color: #6b737e;
  font-size: 12px;
  line-height: 1.8;
}

.selection-pending-brief dd {
  margin: 0;
  color: #454d58;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* Recommendation: the figure and its essential reason precede technical detail. */

.selection-panel .recommendation-form {
  max-width: 800px;
  margin: 28px 0 0 auto;
}

.recommendation-form {
  overflow: hidden;
  border: 1px solid #dfe3e8;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  transition: border-color 120ms var(--ease);
}

.recommendation-form:focus-within {
  border-color: #8e99a8;
}

.recommendation-form textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  max-height: 300px;
  resize: vertical;
  border: 0;
  background: #fff;
  padding: 17px 19px 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.8;
}

.recommendation-form textarea::placeholder {
  color: #6b737e;
  opacity: 1;
}

.recommendation-form textarea:focus-visible {
  outline-offset: -3px;
}

.recommendation-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 10px 10px 19px;
}

.recommendation-compose-footer > span {
  color: #6b737e;
  font-size: 12px;
}

.recommendation-compose-footer .main-button {
  flex-shrink: 0;
  min-height: 44px;
  border-radius: 10px;
}

.recommendation-examples {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 8px;
  color: #6b737e;
  font-size: 12px;
}

.recommendation-examples button {
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 4px 0;
  color: #6b737e;
  font-size: 12px;
}

.recommendation-examples button:hover {
  color: var(--ink);
  text-decoration: underline;
}

.recommendation-status {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #6b737e;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.selection-panel .recommendation-status {
  margin-top: 20px;
  text-align: left;
  justify-content: flex-start;
}

.selection-panel .recommendation-status:has(p:empty):not(:has(button:not([hidden]))) {
  display: none;
}

.recommendation-status p {
  margin: 8px 0 0;
}

.recommendation-status p:empty {
  margin: 0;
}

.recommendation-status-actions {
  display: flex;
  gap: 16px;
}

.selection-panel .selection-previous {
  min-height: 44px;
  margin-top: 14px;
  font-size: 12px;
}

.recommendation-result {
  max-width: 1120px;
  margin: 0 auto 32px;
  padding-bottom: 24px;
}

.selection-panel .recommendation-result {
  margin-top: 28px;
}

.recommendation-snapshot-notice {
  margin: 0 0 18px;
  border-left: 2px solid #8c97a4;
  padding: 7px 12px;
  color: #5c6673;
  font-size: 12px;
  line-height: 1.7;
}

.recommendation-layout {
  display: grid;
  grid-template-columns: 240px minmax(0,1fr);
  align-items: start;
  gap: 36px;
}

.recommendation-brief {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding-right: 24px;
}

.recommendation-brief-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.recommendation-eyebrow {
  color: #6b7480;
  font-size: 12px;
  font-weight: 500;
}

.recommendation-brief-head .inline-action {
  color: #6b737e;
  font-size: 11px;
  white-space: nowrap;
}

.recommendation-brief-details {
  margin: 8px 0 0;
}

.recommendation-brief-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  margin: 8px 0 0;
  color: #626975;
  font-size: 12px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.recommendation-brief-details > summary {
  padding: 11px 0;
  color: #6b737e;
  font-size: 12px;
  line-height: 1.7;
  cursor: pointer;
}

.recommendation-need {
  margin: 11px 0 0;
  color: #454f5c;
  font-size: 12px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.recommendation-facts {
  margin: 13px 0 0;
  padding: 0 0 0 15px;
  color: #6c7581;
  font-size: 11px;
  line-height: 1.85;
}

.recommendation-facts li + li {
  margin-top: 7px;
}

.recommendation-unknown {
  margin-top: 16px;
  color: #707783;
  font-size: 12px;
}

.recommendation-unknown h4 {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 500;
}

.recommendation-unknown ul {
  margin: 0;
  padding-left: 16px;
  line-height: 1.8;
}

.recommendation-main {
  min-width: 0;
}

.recommendation-results-heading {
  margin: 0 0 20px;
}

.recommendation-results-heading h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.02em;
}

.recommendation-results-heading p {
  max-width: 62em;
  margin: 10px 0 0;
  color: #68717d;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.recommendation-questions {
  margin: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}

.recommendation-questions h3 {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 500;
}

.recommendation-questions fieldset {
  min-width: 0;
  margin: 0 0 22px;
  border: 0;
  padding: 0;
}

.recommendation-questions legend {
  margin-bottom: 12px;
  padding: 0;
  color: #303944;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.8;
}

.recommendation-choices {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}

.recommendation-choice {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.recommendation-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.recommendation-choice span {
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid #e0e4e9;
  border-radius: 10px;
  background: #fff;
  padding: 11px 13px;
  color: #636c78;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.recommendation-choice:hover span {
  border-color: #a4a9b1;
  background: #fcfcfd;
}

.recommendation-choice input:checked + span {
  border-color: var(--ink);
  background: #f6f7f8;
  color: #252a31;
}

.recommendation-choice input:focus-visible + span {
  outline: 3px solid #6a8cce;
  outline-offset: 3px;
}

.recommendation-free-answer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 13px;
  color: #6b737e;
  font-size: 11px;
}

.recommendation-free-answer > span {
  flex: 0 0 auto;
}

.recommendation-free-answer input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #e0e4e9;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 12px;
}

.recommendation-free-answer input::placeholder {
  color: #6b737e;
}

.recommendation-question-submit {
  min-height: 44px;
  border-radius: 10px;
  font-size: 13px;
}

.recommendation-candidates {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: start;
  gap: 16px;
}

.recommendation-candidates[data-count="1"] {
  grid-template-columns: minmax(0,1fr);
}

.recommendation-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.recommendation-card[data-role="primary"] {
  border-color: #c3c8d0;
}

.recommendation-preview {
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}

.recommendation-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1.45;
  object-fit: contain;
}

.recommendation-preview:hover {
  background: #fcfcfd;
}

.recommendation-card-copy {
  min-width: 0;
  padding: 20px;
}

.recommendation-role {
  display: inline-block;
  border: 1px solid #e3e6ea;
  border-radius: 5px;
  padding: 3px 7px;
  color: #6b737e;
  font-size: 10px;
  line-height: 1.5;
}

.recommendation-role-note {
  display: inline-block;
  margin-left: 7px;
  color: #6b737e;
  font-size: 10px;
  line-height: 1.5;
}

.recommendation-card[data-role="primary"] .recommendation-role {
  border-color: #252a31;
  background: #252a31;
  color: #fff;
}

.recommendation-card h3 {
  margin: 10px 0 11px;
  color: #252a31;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -.015em;
}

.recommendation-reason {
  margin: 0;
  color: #586372;
  font-size: 12px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.recommendation-primary .recommendation-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
}

.recommendation-primary .recommendation-preview {
  display: flex;
  align-items: center;
  align-self: stretch;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 20px;
}

.recommendation-primary .recommendation-preview img {
  max-height: 350px;
  aspect-ratio: auto;
}

.recommendation-primary .recommendation-card-copy {
  padding: 22px;
}

.recommendation-alternatives,
.recommendation-reference-section {
  margin-top: 26px;
}

.recommendation-alternatives > h3,
.recommendation-reference-section > h3 {
  margin: 0 0 13px;
  color: #5b6572;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.recommendation-reference-copy {
  margin: -4px 0 15px;
  color: #6b737e;
  font-size: 12px;
  line-height: 1.8;
}

.recommendation-secondary-candidates .recommendation-preview img {
  max-height: 190px;
  aspect-ratio: 1.6;
}

.recommendation-secondary-candidates .recommendation-card-copy,
.recommendation-reference-candidates .recommendation-card-copy {
  padding: 17px;
}

.recommendation-secondary-candidates .recommendation-card h3,
.recommendation-reference-candidates .recommendation-card h3 {
  font-size: 16px;
}

.recommendation-reference-candidates {
  grid-template-columns: minmax(0,1fr);
}

.recommendation-reference-candidates .recommendation-card {
  display: grid;
  grid-template-columns: minmax(180px,.7fr) minmax(0,1.6fr);
}

.recommendation-reference-candidates .recommendation-preview {
  display: flex;
  align-items: center;
  align-self: stretch;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 14px;
}

.recommendation-reference-candidates .recommendation-preview img {
  max-height: 200px;
  aspect-ratio: auto;
}

.recommendation-reference-candidates .recommendation-card-copy {
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0 12px;
}

.recommendation-reference-candidates .recommendation-card-head,
.recommendation-reference-candidates .recommendation-reason,
.recommendation-reference-candidates .recommendation-gap-notice,
.recommendation-reference-candidates .recommendation-card-actions {
  flex: 0 0 100%;
}

.recommendation-reference-candidates .recommendation-card-copy > details {
  flex: 1 1 auto;
  min-width: 0;
}

.recommendation-reference-candidates .recommendation-card-copy > details[open] {
  flex-basis: 100%;
}

.recommendation-gap-notice {
  margin-top: 15px;
  border-left: 2px solid #b3b7bd;
  padding: 2px 0 2px 10px;
  color: #6b737e;
  font-size: 11px;
  line-height: 1.8;
}

.recommendation-gap-notice h4 {
  margin: 0 0 4px;
  color: #566170;
  font-size: 11px;
  font-weight: 500;
}

.recommendation-gap-notice > p {
  margin: 0;
  overflow-wrap: anywhere;
}

.recommendation-card-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.8;
}

.recommendation-card-note h4 {
  margin: 0 0 5px;
  color: #495562;
  font-size: 12px;
  font-weight: 500;
}

.recommendation-card-note ul,
.recommendation-data ul,
.recommendation-caveats ul,
.recommendation-gap-details ul {
  margin: 9px 0 0;
  padding-left: 16px;
  color: #68727e;
  font-size: 11px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.recommendation-card-note li + li,
.recommendation-data li + li,
.recommendation-caveats li + li,
.recommendation-gap-details li + li {
  margin-top: 6px;
}

.recommendation-data,
.recommendation-caveats,
.recommendation-evidence {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
  color: #6d7785;
  font-size: 11px;
  line-height: 1.8;
}

.recommendation-data > summary,
.recommendation-caveats > summary,
.recommendation-evidence > summary,
.recommendation-gap-details > summary {
  min-height: 36px;
  padding: 8px 0;
  color: #6d7785;
  font-size: 11px;
  line-height: 1.8;
  cursor: pointer;
}

.recommendation-caveats[open] > summary {
  color: #535e6b;
}

.recommendation-gap-details {
  margin-top: 3px;
}

.recommendation-evidence blockquote {
  margin: 9px 0;
  border-left: 2px solid #dfe4e9;
  padding-left: 10px;
  overflow-wrap: anywhere;
}

.recommendation-card-actions {
  margin-top: 14px;
}

.recommendation-open {
  min-height: 44px;
  border: 1px solid #d6dbe2;
  border-radius: 10px;
  background: #fff;
  padding: 10px 13px;
  color: #303944;
  font-size: 12px;
  text-decoration: none;
}

.recommendation-open:hover {
  border-color: #8e98a6;
  background: #f8f9fa;
  text-decoration: none;
}

.recommendation-card[data-role="primary"] .recommendation-open {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.recommendation-card[data-role="primary"] .recommendation-open:hover {
  background: #343841;
}

@media (max-width:1000px) {
  .selection-workspace {
    grid-template-columns: minmax(0,1fr) 210px;
    gap: 26px;
  }
  .selection-choices[data-question="goal"] {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .selection-choices[data-question="goal"] .selection-choice {
    min-height: 98px;
  }
  .recommendation-layout {
    grid-template-columns: 210px minmax(0,1fr);
    gap: 26px;
  }
  .recommendation-primary .recommendation-card {
    display: block;
  }
  .recommendation-primary .recommendation-preview {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .recommendation-primary .recommendation-preview img {
    max-height: 290px;
  }
}

@media (max-width:900px) {
  .selection-workspace {
    grid-template-columns: minmax(0,1fr);
    gap: 26px;
  }
  .selection-summary {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 20px 0 0;
  }
  .selection-summary-head {
    display: inline-flex;
    margin-right: 12px;
  }
  .selection-summary-count,
  .selection-summary-label {
    display: inline-block;
    margin-bottom: 13px;
  }
  .selection-summary-list {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px 22px;
  }
  .selection-summary-item {
    border: 0;
    padding: 0;
  }
  .recommendation-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .recommendation-brief {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 10px;
  }
  .recommendation-brief-head {
    min-height: 40px;
  }
  .recommendation-brief-details {
    margin-top: 0;
  }
  .recommendation-main {
    width: 100%;
  }
  .selection-panel .recommendation-form {
    max-width: none;
  }
}

@media (max-width:760px) {
  .library-heading {
    display: block;
    padding-top: 24px;
  }
  .library-search {
    width: 100%;
    margin-top: 20px;
  }
  .recommendation-reference-candidates .recommendation-card {
    display: block;
  }
  .recommendation-reference-candidates .recommendation-preview {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }
  .recommendation-reference-candidates .recommendation-preview img {
    max-height: 180px;
    aspect-ratio: 1.6;
  }
}

@media (max-width:560px) {
  .selection-choices,
  .selection-choices[data-question="goal"],
  .recommendation-choices,
  .recommendation-candidates {
    grid-template-columns: minmax(0,1fr);
  }
  .selection-stage-track {
    gap: 0;
    justify-content: space-between;
    margin-bottom: 22px;
    font-size: 10px;
  }
  .selection-stage {
    gap: 5px;
  }
  .selection-stage + .selection-stage::before {
    width: 8px;
    margin-inline: 6px;
  }
  .selection-stage-marker {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
    font-size: 9px;
  }
  .selection-question-heading,
  .selection-review-header h2 {
    font-size: 25px;
  }
  .selection-question-help,
  .selection-review-header p {
    margin-bottom: 20px;
    font-size: 12px;
  }
  .selection-choice,
  .selection-choices[data-question="goal"] .selection-choice {
    min-height: 84px;
    padding: 15px 16px;
  }
  .selection-choice[data-value="unknown"] .selection-choice-copy {
    display: block;
  }
  .selection-choice[data-value="unknown"] .selection-choice-help {
    margin-top: 3px;
  }
  .selection-summary-list {
    grid-template-columns: minmax(0,1fr);
  }
  .selection-notes {
    font-size: 16px;
  }
  .selection-pending {
    padding-top: 30px;
  }
  .selection-pending-head {
    align-items: flex-start;
    gap: 13px;
  }
  .selection-pending-loader {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
    margin-top: 5px;
  }
  .selection-pending-title {
    font-size: 21px;
  }
  .selection-pending-brief > div {
    display: block;
    padding: 12px 0;
  }
  .selection-pending-brief dd {
    margin-top: 4px;
  }
  .recommendation-form textarea {
    min-height: 118px;
    padding: 14px 14px 6px;
    font-size: 16px;
    line-height: 1.65;
  }
  .recommendation-compose-footer {
    gap: 12px;
    padding-left: 14px;
  }
  .recommendation-compose-footer > span {
    max-width: 12em;
    font-size: 11px;
    line-height: 1.6;
  }
  .recommendation-examples {
    gap: 2px 12px;
  }
  .recommendation-result {
    margin-bottom: 24px;
    padding-bottom: 24px;
  }
  .recommendation-results-heading h2 {
    font-size: 23px;
  }
  .recommendation-data > summary,
  .recommendation-caveats > summary,
  .recommendation-evidence > summary,
  .recommendation-gap-details > summary {
    min-height: 44px;
    padding-block: 12px;
  }
  .recommendation-questions {
    padding: 18px 16px;
  }
  .recommendation-free-answer {
    display: block;
  }
  .recommendation-free-answer > span {
    display: block;
    margin-bottom: 6px;
  }
  .recommendation-free-answer input {
    width: 100%;
    font-size: 16px;
  }
  .recommendation-card-copy,
  .recommendation-primary .recommendation-card-copy {
    padding: 18px;
  }
  .recommendation-primary .recommendation-preview {
    padding: 18px;
  }
}

@media (max-width:480px) {
  .intro {
    padding-top: 4px;
    margin-bottom: 32px;
  }
  .hero-actions {
    margin-top: 22px;
  }
  .hero-select {
    min-width: 150px;
  }
  .hero-action-note {
    margin-top: 12px;
  }
  .library-heading h2 {
    padding-top: 0;
    font-size: 20px;
  }
  .library-search .figure-search input {
    font-size: 16px;
  }
  .library-search .search-example {
    min-height: 44px;
  }
  .search-scope {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .selection-panel {
    margin-top: -17px;
  }
  .selection-workspace {
    padding-top: 24px;
  }
  .selection-navigation {
    padding-top: 16px;
  }
}

@media (max-width:400px) {
  .selection-stage-track {
    justify-content: space-between;
  }
  .selection-stage + .selection-stage::before {
    display: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  #selection-question,
  #selection-confirmation,
  .selection-pending-loader {
    animation: none;
  }
  .selection-choice,
  .recommendation-form {
    transition: none;
  }
}

/* 登录限制与现有资源栏共用白色画布。 */
.access-notice {
  padding: 68px 24px 56px;
  text-align: center;
}
.access-lock { width: 28px; height: 28px; margin-bottom: 18px; color: var(--muted, #737c89); }
.access-notice h3 { margin: 0 0 10px; font-size: 20px; font-weight: 600; }
.access-notice p { margin: 0 auto 26px; max-width: 320px; color: var(--muted, #737c89); font-size: 13px; line-height: 1.7; }
.access-notice .main-button { display: inline-flex; justify-content: center; text-decoration: none; min-width: 140px; }
.access-notice .inline-action { display: block; margin: 14px auto 0; }
.access-notice [hidden] { display: none; }
.point-code-access { margin-top: 18px; }
