:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f7f5;
  --surface-muted: #f1f1ef;
  --ink: #101010;
  --muted: #6f6f6d;
  --line: #e3e3e0;
  --line-strong: #cacac6;
  --accent: #c3443b;
  --accent-soft: #f7e7e4;
  --focus: #1d68ae;
  --shadow: 0 24px 60px rgba(16, 16, 16, 0.16);
  --content: 1180px;
  --radius-pill: 999px;
  --radius-card: 16px;
  --radius-control: 9px;
}

@font-face {
  font-family: "Awesome Plex";
  src: url("./fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Awesome Plex";
  src: url("./fonts/IBMPlexSans-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Awesome Plex";
  src: url("./fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Awesome Plex";
  src: url("./fonts/IBMPlexSans-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Awesome Plex", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
select {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
dialog:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

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

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.035em;
}

.site-header,
main,
.site-footer {
  width: min(var(--content), calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 3px;
  width: 25px;
  height: 25px;
  padding: 2px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.brand-mark span {
  display: block;
  border-radius: 2px;
  background: var(--ink);
}

.brand-mark span:nth-child(2) {
  background: var(--accent);
}

.brand-mark span:nth-child(3) {
  background: transparent;
  border: 1px solid var(--ink);
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

.language-toggle {
  min-width: 40px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.language-toggle:hover {
  border-color: var(--ink);
  background: var(--surface-soft);
}

a[target="_blank"]::after {
  display: inline-block;
  width: 0.65em;
  height: 0.65em;
  margin-left: 0.28em;
  border-top: 1.25px solid currentColor;
  border-right: 1.25px solid currentColor;
  content: "";
  transform: translateY(0.04em);
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 30px 0 18px;
}

.masthead-copy {
  max-width: 760px;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 4.5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.02;
}

h1 em {
  color: inherit;
  font-style: normal;
}

.lede {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.6;
}

.masthead-note {
  display: grid;
  flex: 0 0 165px;
  gap: 4px;
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.masthead-note strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.note-rule {
  display: block;
  width: 34px;
  height: 3px;
  margin-bottom: 5px;
  background: var(--ink);
}

.muted {
  color: var(--muted);
}

.search-section {
  padding-bottom: 16px;
}

.search-shell {
  display: flex;
  align-items: center;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  transition: box-shadow 120ms ease, background-color 120ms ease;
}

.search-shell:focus-within {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(29, 104, 174, 0.17);
}

.search-symbol {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-left: 19px;
  border: 1.7px solid var(--muted);
  border-radius: 50%;
}

.search-symbol::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.7px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-shell input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 14px 11px 16px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.search-shell input::placeholder {
  color: #6b6b69;
}

.search-count {
  flex: 0 0 auto;
  min-width: 55px;
  padding: 0 18px;
  color: var(--ink);
  font-size: 12px;
  text-align: right;
}

.search-hint {
  margin: 8px 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.collection-tabs,
.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.collection-tab,
.quiet-button {
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
}

.collection-tab {
  color: var(--muted);
}

.collection-tab b {
  color: inherit;
  font-size: 12px;
  font-weight: 500;
}

.collection-tab:hover,
.collection-tab:focus-visible,
.collection-tab.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.quiet-button {
  border-color: var(--line-strong);
  color: var(--muted);
}

.quiet-button:hover,
.quiet-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--surface-soft);
  color: var(--ink);
}

.select-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.select-control select {
  min-width: 100px;
  padding: 6px 24px 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-soft);
  font-size: 12px;
}

.market-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 14px 0 0;
}

.category-strip {
  position: sticky;
  top: 20px;
  min-width: 0;
  padding: 0;
}

.strip-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.strip-heading h2 {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.strip-line {
  height: 1px;
  flex: 1;
  background: var(--line);
}

.category-list {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.category-chip {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
}

.category-chip:hover,
.category-chip:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
}

.category-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 34px;
  min-width: 0;
  align-items: start;
  padding-bottom: 60px;
}

.results-section {
  min-width: 0;
}

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ink);
}

.results-heading h2 {
  margin-bottom: 8px;
  font-size: 21px;
  font-weight: 600;
}

.heading-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.results-heading-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 10px;
  min-width: 0;
}

.results-status {
  max-width: 240px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.copy-results {
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
}

.results-heading-tools .copy-status {
  min-height: 0;
  margin: 0;
}

.results-heading-tools .copy-status:empty {
  display: none;
}

.route-status {
  margin: 5px 0 0;
  color: var(--accent);
  font-size: 12px;
}

.scenario-panel[hidden] {
  display: none;
}

.scenario-panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.scenario-panel h3 {
  margin-bottom: 6px;
  font-size: 19px;
  line-height: 1.25;
}

.scenario-panel > p {
  max-width: 70ch;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.scenario-panel #scenario-start {
  color: var(--ink);
}

.scenario-panel #scenario-start .text-button {
  margin-left: 7px;
  padding: 5px 8px;
}

.scenario-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 0 0;
}

.scenario-actions .detail-action {
  white-space: nowrap;
}

.scenario-panel > .copy-status {
  margin-top: 7px;
}

.scenario-panel details {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line-strong);
}

.scenario-panel summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.scenario-panel summary::marker {
  color: var(--accent);
}

#scenario-guide-content {
  padding-top: 14px;
}

.scenario-materials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  margin-bottom: 21px;
}

.scenario-materials h4,
#scenario-guide-content > h4,
.scenario-steps + h4 {
  margin-bottom: 9px;
  font-size: 13px;
  letter-spacing: 0;
}

.scenario-steps {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0 0 0 21px;
}

.scenario-steps li {
  padding-left: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.scenario-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.scenario-steps li > strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 14px;
}

.scenario-steps .prompt-text {
  max-width: 70ch;
  margin: 0 0 7px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.scenario-steps li > p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.scenario-steps .text-button {
  padding: 6px 9px;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.scenario-steps .text-button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

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

.result-row {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.result-row:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(16, 16, 16, 0.07);
  transform: translateY(-1px);
}

.entry-avatar {
  display: block;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  margin: 0 0 10px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.result-main {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.entry-kicker,
.entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
}

.entry-kicker {
  min-height: 15px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.kind-tag {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.source-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row h3 {
  margin-bottom: 5px;
  font-size: 18px;
  line-height: 1.18;
}

.entry-title {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 600;
  text-align: left;
}

.entry-title:hover {
  color: var(--accent);
}

.entry-summary {
  display: -webkit-box;
  max-width: 50ch;
  margin-bottom: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.entry-meta {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
}

.entry-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.entry-meta span::before {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.favorite-button,
.detail-button,
.card-download {
  min-height: 29px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.favorite-button,
.card-download {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}

.favorite-button:hover,
.favorite-button[aria-pressed="true"],
.card-download:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.favorite-button[aria-pressed="true"]::before {
  content: "● ";
  color: var(--accent);
  font-size: 8px;
  vertical-align: 1px;
}

.detail-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}

.detail-button:hover {
  border-color: var(--accent);
  background: var(--accent);
}

@media (min-width: 761px) {
  .result-row {
    padding-inline: 12px;
  }

  .result-actions {
    gap: 0;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .result-actions > .favorite-button,
  .result-actions > .detail-button,
  .result-actions > .card-download {
    padding-inline: 3px;
    font-size: 11px;
    letter-spacing: -0.015em;
  }
}

.directory-aside {
  min-width: 0;
  padding-left: 25px;
  border-left: 1px solid var(--line);
}

.aside-block {
  padding: 0 0 22px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.aside-block h2 {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.aside-copy {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.aside-guide {
  margin: -3px 0 12px;
}

.download-links {
  display: grid;
  gap: 0;
}

.download-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
}

.download-link:last-child {
  border-bottom: 1px solid var(--line);
}

.download-link:hover {
  color: var(--accent);
}

.download-link.is-disabled {
  cursor: default;
  color: var(--muted);
}

.download-link.is-disabled:hover {
  color: var(--muted);
}

.download-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-title b {
  color: var(--muted);
  font-weight: 500;
}

.download-arrow {
  position: relative;
  display: inline-block;
  flex: 0 0 12px;
  width: 12px;
  height: 14px;
  color: currentColor;
}

.download-arrow::before {
  position: absolute;
  top: 1px;
  left: 5px;
  width: 1.5px;
  height: 10px;
  background: currentColor;
  content: "";
}

.download-arrow::after {
  position: absolute;
  bottom: 1px;
  left: 3px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.download-limit {
  max-width: 165px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.text-link {
  color: var(--ink);
  font-size: 12px;
  text-underline-offset: 4px;
}

.text-link:hover {
  color: var(--accent);
}

.copy-button,
.text-button {
  padding: 8px 11px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
}

.copy-button:hover,
.text-button:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.copy-status {
  min-height: 1.35em;
  margin: 8px 0 0;
  color: var(--accent);
  font-size: 12px;
}

.empty-state {
  padding: 48px 0 58px;
  border-bottom: 1px solid var(--ink);
}

.empty-mark {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
}

.empty-state h3 {
  margin-bottom: 7px;
  font-size: 22px;
}

.empty-state p {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state .text-button {
  display: inline-block;
  text-decoration: none;
}

.empty-state .text-button + .text-button {
  margin-left: 8px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.site-footer p {
  margin-bottom: 0;
}

.site-footer a {
  text-underline-offset: 4px;
}

.detail-dialog {
  width: min(820px, calc(100% - 32px));
  max-height: min(90vh, 850px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.detail-dialog::backdrop {
  background: rgba(16, 16, 16, 0.42);
}

.detail-shell {
  max-height: min(90vh, 850px);
  overflow-y: auto;
  padding: 30px 32px 36px;
}

.detail-header {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: 17px;
  padding-right: 42px;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}

.detail-avatar {
  display: block;
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.detail-header > h2,
.detail-header > .detail-summary,
.detail-header > .detail-source {
  grid-column: 2;
}

.detail-header h2 {
  margin-bottom: 8px;
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 600;
  line-height: 1.06;
}

.detail-summary {
  max-width: 620px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.detail-source {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-source a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.detail-close {
  position: absolute;
  top: -3px;
  right: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  line-height: 1;
}

.detail-close::before,
.detail-close::after {
  position: absolute;
  top: 15px;
  left: 8px;
  width: 13px;
  height: 1.5px;
  background: currentColor;
  content: "";
}

.detail-close::before {
  transform: rotate(45deg);
}

.detail-close::after {
  transform: rotate(-45deg);
}

.detail-close:hover {
  border-color: var(--ink);
  background: var(--surface-soft);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 18px 0 10px;
}

.detail-action {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  text-decoration: none;
}

.detail-action.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.detail-action:hover,
.detail-action.secondary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.detail-resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  padding: 0 0 17px;
  border-bottom: 1px solid var(--line);
}

.detail-resource-links .detail-action.secondary {
  min-height: 0;
  padding: 3px 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-resource-links .detail-action.secondary:hover {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

.detail-resource-links + .copy-status + .detail-section {
  border-top: 0;
}

.detail-section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.detail-section p,
.detail-section pre {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 21px 28px;
}

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

.detail-list li {
  position: relative;
  padding-left: 15px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.detail-list li::before {
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 5px;
  height: 1px;
  background: var(--accent);
  content: "";
}

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

.skill-list li {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 14px;
}

.skill-list strong {
  color: var(--ink);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.permission {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 12px;
}

.permission strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

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

.verification-line {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 17px;
  color: var(--muted);
  font-size: 12px;
}

.verification-line strong {
  color: var(--ink);
}

.no-script {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}

@media (min-width: 1180px) {
  .results-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1060px) {
  .market-layout {
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 20px;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr) 215px;
    gap: 24px;
  }

  .select-control select {
    min-width: 86px;
  }
}

@media (max-width: 900px) {
  .market-layout {
    display: block;
  }

  .category-strip {
    position: static;
    padding-bottom: 12px;
  }

  .category-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 1px 0 5px;
    scrollbar-width: thin;
  }

  .category-chip {
    width: auto;
    flex: 0 0 auto;
    padding-block: 7px;
    text-align: center;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .directory-aside {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding-left: 0;
    border-left: 0;
  }

  .aside-block {
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .site-header,
  main,
  .site-footer {
    width: min(var(--content), calc(100% - 32px));
  }

  .site-header {
    min-height: 64px;
  }

  .site-nav {
    gap: 11px;
  }

  .site-nav a:first-child,
  .site-nav a:nth-child(2) {
    display: none;
  }

  .masthead {
    display: block;
    padding: 22px 0 13px;
  }

  .masthead-note {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-top: 10px;
  }

  .note-rule {
    width: 25px;
    margin-bottom: 0;
  }

  .catalog-toolbar {
    display: block;
    padding: 7px 0 8px;
  }

  .collection-tabs {
    margin-bottom: 6px;
  }

  .toolbar-controls {
    justify-content: space-between;
    gap: 6px;
  }

  .select-control {
    flex: 1;
    justify-content: space-between;
  }

  .select-control select {
    min-width: 0;
    max-width: 135px;
  }

  .quiet-button {
    flex: 0 0 auto;
  }

  .category-strip {
    padding-bottom: 10px;
  }

  .category-list {
    margin-right: -1px;
  }

  .results-heading {
    align-items: end;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .results-heading-tools {
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
  }

  .results-status {
    max-width: 160px;
    margin-bottom: 0;
    text-align: right;
  }

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

  .detail-grid,
  .permission-grid,
  .scenario-materials {
    grid-template-columns: 1fr;
  }

  .directory-aside {
    display: block;
  }

  .aside-block {
    padding-top: 22px;
  }

  .detail-shell {
    padding: 25px 21px 30px;
  }
}

@media (max-width: 480px) {
  .site-header,
  main,
  .site-footer {
    width: min(var(--content), calc(100% - 24px));
  }

  .brand-copy small {
    display: none;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.45rem);
  }

  .lede {
    font-size: 15px;
    line-height: 1.45;
  }

  .search-shell {
    min-height: 48px;
  }

  .search-shell input {
    min-height: 46px;
    padding-right: 7px;
    padding-left: 12px;
    font-size: 14px;
  }

  .search-symbol {
    margin-left: 16px;
  }

  .search-count {
    min-width: 45px;
    padding: 0 12px 0 4px;
    font-size: 12px;
  }

  .strip-heading {
    margin-bottom: 7px;
  }

  .toolbar-controls {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .select-control {
    min-width: 0;
    gap: 4px;
  }

  .toolbar-controls .select-control:first-child {
    display: none;
  }

  .toolbar-controls .select-control:nth-child(2) {
    flex: 1 1 auto;
  }

  .toolbar-controls .select-control:nth-child(3) {
    flex: 0 0 86px;
  }

  .select-control select {
    min-width: 0;
    width: auto;
    flex: 1 1 0;
    padding-inline: 7px;
  }

  .toolbar-controls .select-control:nth-child(3) select {
    padding-inline: 5px;
    font-size: 11px;
  }

  .quiet-button {
    flex: 0 0 86px;
    width: auto;
    padding-inline: 7px;
  }

  .result-row {
    min-height: 0;
    padding: 12px 13px 11px;
  }

  .entry-avatar {
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
  }

  .result-actions {
    align-items: stretch;
    justify-content: flex-start;
    margin-top: 8px;
    padding-top: 8px;
  }

  .result-actions .detail-button {
    margin-left: auto;
  }

  .empty-state .text-button + .text-button {
    margin-top: 8px;
    margin-left: 0;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 24px 0;
  }

  .detail-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px;
    border-radius: 15px;
  }

  .detail-shell {
    max-height: calc(100vh - 16px);
  }

  .detail-header {
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: 13px;
    padding-right: 38px;
  }

  .detail-avatar {
    width: 56px;
    height: 56px;
  }

  .detail-header h2 {
    font-size: 1.75rem;
  }

  html:lang(en) .masthead {
    padding: 22px 0 13px;
  }

  html:lang(en) .masthead-note {
    padding-top: 10px;
  }

  html:lang(en) .search-section {
    padding-bottom: 16px;
  }

  html:lang(en) .category-strip {
    padding-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
