:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #171b22;
  background: #fff;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; }
}
body { margin: 0; }
a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.site {
  container-type: inline-size;
  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.page-width { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 40px; }
main { flex: 1; min-width: 0; }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  padding-bottom: 24px;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -.045em;
}

.brand img { width: 29px; height: 29px; }
.github {
  color: #737b87;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 8px;
  font-size: .8rem;
  text-decoration: none;
  border-radius: 8px;
  transition: color .18s, background .18s;
}
.github svg { width: 19px; height: 19px; }
.github:hover { color: #171b22; background: #f4f5f7; }

.intro-section { padding-top: 16px; padding-bottom: 48px; }
.intro-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.intro-heading-row h1 { margin: 0; font-size: clamp(1.5rem, 3.2vw, 2.25rem); font-weight: 500; line-height: 1.4; letter-spacing: -.035em; }
.carousel-controls { display: flex; align-items: center; gap: 8px; flex: none; }
.carousel-controls output { margin-right: 8px; color: #818995; font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.carousel-arrow {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #e4e8ec;
  border-radius: 8px;
  color: #737b87;
  background: #fff;
  cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
}
.carousel-arrow svg { width: 18px; height: 18px; }
.carousel-arrow:hover:not(:disabled) { color: #171b22; border-color: #b8c2cc; background: #f8f9fa; }
.carousel-arrow:disabled { cursor: default; opacity: .5; }
.project-track {
  --card-width: 340px;
  --card-overlap: 64px;
  --edge-space: max(6px, calc((100% - var(--card-width)) / 2));
  display: flex;
  gap: 0;
  position: relative;
  margin: -20px -6px;
  padding: 20px var(--edge-space);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  scrollbar-width: none;
  list-style: none;
}
.project-track::-webkit-scrollbar { display: none; }
.project-track.is-scrubbing { scroll-snap-type: none; }
.project-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 0 0 var(--card-width);
  padding: 24px;
  border: 1px solid #e8ebee;
  border-radius: 12px;
  background: #fff;
  scroll-snap-align: center;
  transform: perspective(1200px) translateZ(calc(var(--card-depth, 36px) * var(--depth-scale, 1) * -1)) rotateY(calc(var(--card-angle, 0deg) * var(--angle-scale, 1))) scale(var(--card-scale, .96));
  transform-origin: center;
  box-shadow: 0 4px 12px -10px #26364630;
  transition: transform .28s ease-out, box-shadow .28s ease-out, border-color .18s, background .18s;
}
.project-card + .project-card { margin-left: calc(var(--card-overlap) * -1); }
.project-card:hover { border-color: #c3cdd6; }
.project-card.is-selected { z-index: 3; transform: none; border-color: #96a6b5; box-shadow: 0 12px 24px -16px #26364655; }
.project-header {
  display: flex;
  gap: 12px;
  align-items: center;
}
.project-header h2 { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-size: 1.05rem; font-weight: 600; white-space: nowrap; }
.project-select { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.project-select:disabled { cursor: default; }
/* 卡片选择与进入网站是独立操作，不在链接内嵌套按钮。 */
.project-select::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.project-description { margin: 16px 0 20px; color: #737b87; font-size: .82rem; line-height: 1.85; }
.product-link { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-height: 34px; margin-left: auto; padding: 8px 12px; border-radius: 6px; color: #fff; background: #252d35; font-size: .75rem; line-height: 1.4; text-decoration: none; white-space: nowrap; transition: background .18s; }
.product-link:hover { background: #46515d; }
.product-link .arrow, .project-permalink .arrow { display: inline-block; transition: transform .18s ease-out; }
.product-link:hover .arrow, .project-permalink:hover .arrow { transform: translateX(2px); }
.card-meta { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin-top: auto; padding-top: 16px; border-top: 1px solid #eef0f3; }
.card-meta .source { flex: 1 1 210px; }
.card-meta .platform-note { flex: 1 1 180px; }
.unavailable-action { color: #949ca7; font-size: .75rem; line-height: 1.8; }
a:focus-visible, button:focus-visible { outline: 2px solid #3077c9; outline-offset: 3px; }
.project-select:focus-visible { outline: none; }
.project-select:focus-visible::after { outline: 2px solid #3077c9; outline-offset: 3px; }

.project-pagination { --project-count: 3; position: relative; display: grid; grid-template-columns: repeat(var(--project-count), minmax(0, 1fr)); width: min(100%, 420px); margin: 24px auto 0; }
.project-jump { border: 0; padding: 10px 8px; background: transparent; color: #8a929e; font-size: .75rem; line-height: 1.8; cursor: pointer; }
.project-jump:hover, .project-jump[aria-current="true"] { color: #252d35; }
.project-jump[aria-current="true"] { font-weight: 500; }
.project-scrollbar { grid-column: 1 / -1; appearance: none; width: 100%; height: 28px; margin: 0; border: 0; border-radius: 6px; background: transparent; cursor: ew-resize; touch-action: pan-y; }
.project-scrollbar::-webkit-slider-runnable-track { height: 6px; border-radius: 4px; background: #edf0f3; }
.project-scrollbar::-webkit-slider-thumb { appearance: none; width: var(--thumb-width, 140px); height: 6px; border: 0; border-radius: 4px; background: #566574; cursor: grab; }
.project-scrollbar::-moz-range-track { height: 6px; border-radius: 4px; background: #edf0f3; }
.project-scrollbar::-moz-range-progress { background: transparent; }
.project-scrollbar::-moz-range-thumb { width: var(--thumb-width, 140px); height: 6px; border: 0; border-radius: 4px; background: #566574; cursor: grab; }
.project-scrollbar:active::-webkit-slider-thumb { background: #293743; cursor: grabbing; }
.project-scrollbar:active::-moz-range-thumb { background: #293743; cursor: grabbing; }
.project-scrollbar:focus-visible { outline: 2px solid #3077c9; outline-offset: 3px; }

.detail-copy { padding-top: 24px; padding-bottom: 24px; }
.detail-text { width: 100%; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.detail-heading:has(.download-controls) { align-items: flex-start; }
.detail-text .detail-heading h2 { margin-bottom: 0; }
.detail-text h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; color: #222c36; font-size: 1.6rem; line-height: 1.4; font-weight: 500; letter-spacing: -.02em; }
.detail-text p { margin: 0; color: #737b87; font-size: .88rem; line-height: 1.9; }
.project-body ul { margin: 16px 0 0; padding-left: 1.2em; color: #737b87; font-size: .88rem; line-height: 1.9; }
.project-body li + li { margin-top: 6px; }
.project-body li::marker { color: #a4adb7; }
.project-body h3 { margin: 24px 0 8px; color: #38434f; font-size: .9rem; font-weight: 500; }
.project-body code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85em; }
.project-body pre { overflow-x: auto; margin: 12px 0; padding: 12px 14px; border-radius: 6px; background: #f5f7f9; color: #38434f; line-height: 1.7; }
.project-body .visual-stage { margin-top: 24px; padding: 32px 0 24px; }
.project-body .screen p { max-width: none; margin: 0; }
.project-body .screen .notist-embed { display: block; }
.db-models, .db-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.db-models p, .db-spread p {
  margin: 0;
  overflow: hidden;
  border: 1px solid #e1e6eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 0 #e4e9ed, 0 14px 28px -20px #2636463c;
  transition: transform .22s ease-out, box-shadow .22s ease-out;
}
.db-models img, .db-spread img {
  display: block;
  width: 100%;
  height: auto;
}
@media (hover: hover) and (pointer: fine) {
  .db-models p:hover, .db-spread p:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 0 #e7ebef, 0 20px 30px -18px #26364648;
  }
}
.db-fan {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  margin-top: 22px;
  padding: 28px 16px 36px;
  isolation: isolate;
}
.db-fan p {
  grid-area: 1 / 1;
  width: min(62%, 520px);
  margin: 0;
  overflow: hidden;
  border: 1px solid #dce2e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 0 #e4e9ed, 0 18px 36px -20px #1e2d3b55;
  transform-origin: center 88%;
  transition: transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s ease-out, filter .28s ease-out;
}
.db-fan img {
  display: block;
  width: 100%;
  height: auto;
}
.db-fan p:nth-child(1) {
  z-index: 1;
  transform: translate(-44%, 4%) rotate(-8deg) scale(.86);
  filter: brightness(.95);
}
.db-fan p:nth-child(2) {
  z-index: 3;
  transform: translate(0, 0) scale(1);
}
.db-fan p:nth-child(3) {
  z-index: 2;
  transform: translate(44%, 4%) rotate(8deg) scale(.86);
  filter: brightness(.95);
}
@media (hover: hover) and (pointer: fine) {
  .db-fan p:hover {
    z-index: 5;
    filter: none;
    box-shadow: 0 4px 0 #e4e9ed, 0 28px 48px -20px #1b2a3868;
  }
  .db-fan p:nth-child(1):hover { transform: translate(-36%, -2%) rotate(-2deg) scale(.98); }
  .db-fan p:nth-child(2):hover { transform: translate(0, -4px) scale(1.03); }
  .db-fan p:nth-child(3):hover { transform: translate(36%, -2%) rotate(2deg) scale(.98); }
}
@media (max-width: 700px) {
  .db-models, .db-spread { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .db-fan { gap: 14px; padding: 8px 0 4px; }
  .db-fan p { grid-area: auto; width: 100%; filter: none !important; transform: none !important; }
}
.project-permalink { display: inline-block; margin-top: 20px; color: #737b87; font-size: .75rem; text-decoration: none; }
.project-permalink:hover, .project-back a:hover { color: #252d35; text-decoration: underline; }
.project-back { padding-block: 12px; }
.project-back a { color: #737b87; font-size: .82rem; text-decoration: none; }

.download-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; width: min(100%, 340px); min-width: 0; margin-left: auto; }
.download-split { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 4px 0; align-items: stretch; min-width: 0; }
.download-controls .download-primary { justify-content: center; gap: 8px; min-width: 0; margin-left: 0; min-height: 34px; height: 34px; padding: 8px 12px; border: 1px solid #dfe4ea; border-right: 0; border-radius: 6px 0 0 6px; }
.download-primary svg { width: 14px; height: 14px; flex: none; }
.download-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.download-title { overflow: hidden; text-overflow: ellipsis; font-size: inherit; line-height: 1.4; white-space: nowrap; }
.download-filename { grid-column: 1 / -1; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8a929e; font-size: .6rem; line-height: 1.35; }
.download-version { font-variant-numeric: tabular-nums; }
.download-primary[aria-disabled="true"] { background: #f2f4f6; color: #949da8; cursor: not-allowed; }
.download-options { position: relative; }
.download-toggle { display: grid; place-items: center; width: 30px; height: 34px; border: 1px solid #dfe4ea; border-radius: 0 6px 6px 0; background: #fff; color: #66717d; list-style: none; cursor: pointer; }
.download-toggle::-webkit-details-marker { display: none; }
.download-toggle::marker { content: ""; }
.download-toggle:hover, .download-options[open] .download-toggle { background: #f6f8fa; color: #252d35; }
.download-toggle svg { width: 16px; height: 16px; transition: transform .16s ease-out; }
.download-options[open] .download-toggle svg { transform: rotate(180deg); }
.download-toggle:focus-visible { position: relative; z-index: 1; outline: 2px solid #3077c9; outline-offset: 3px; }
.download-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 10; width: 300px; max-width: calc(100cqw - 48px); padding: 6px; border: 1px solid #e1e6eb; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #2636461a; }
.download-option { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 10px; border: 0; border-radius: 4px; background: transparent; color: #28333e; text-align: left; cursor: pointer; }
.download-option { text-decoration: none; }
.download-option:hover:not([aria-disabled="true"]) { background: #f6f8fa; }
.download-option[aria-disabled="true"] { color: #949da8; cursor: not-allowed; }
.download-feedback { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; }
.detail-text .download-status, .detail-text .download-menu-label { color: #8a929e; font-size: .68rem; line-height: 1.7; }
.detail-text .download-menu-label { padding: 6px 10px; }
.download-retry { flex: none; padding: 0; border: 0; background: none; color: #3077c9; font-size: .7rem; cursor: pointer; }
.legal-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 24px; font-size: .7rem; }
.legal-footer a { color: #818995; text-decoration: none; }
.legal-police { display: inline-flex; align-items: center; gap: 5px; }
.legal-police img { display: block; width: 18px; height: 20px; object-fit: contain; }
.download-option-title { font-size: .8rem; line-height: 1.6; }
.download-option-note { max-width: 100%; overflow-wrap: anywhere; font-size: .65rem; line-height: 1.6; color: #8a929e; }
.visual-stage { position: relative; isolation: isolate; padding: 32px 40px 48px; }
.visual-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 20px;
  left: 50%;
  width: 100cqw;
  transform: translateX(-50%);
  height: 480px;
  max-height: calc(100% - 24px);
  background-image: radial-gradient(circle, #dce1e7 .8px, transparent .9px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 80%, transparent);
  pointer-events: none;
}
.screen {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  border: 1px solid #e1e6eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 0 #e4e9ed, 0 16px 36px -24px #26364640;
  transition: transform .24s ease-out;
}
/* 图片、边框、阴影只在 figure 外层统一变换，不叠加独立背板。 */
.screen.is-tilting { transform: perspective(1800px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); }
.screen img { display: block; width: 100%; height: auto; }
.preview-placeholder { display: grid; place-items: center; width: 100%; max-width: 1040px; aspect-ratio: 26 / 17; margin-inline: auto; border: 1px dashed #dce2e8; border-radius: 12px; background: #fff; color: #949ca7; font-size: .8rem; }
.source {
  margin: 0;
  color: #737b87;
  font-size: .7rem;
  line-height: 1.8;
}
.source a { position: relative; z-index: 1; display: inline-block; color: inherit; text-decoration-color: #c1c6ce; text-underline-offset: 3px; white-space: nowrap; }
.source a:hover { color: #3077c9; text-decoration-color: currentColor; }
.repo-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  padding-block: 4px;
  color: #737b87;
  font-size: .7rem;
  line-height: 1.8;
  text-decoration: none;
  white-space: nowrap;
}
.repo-link svg { width: 14px; height: 14px; flex: none; }
.repo-link:hover { color: #171b22; }
.platform-note { margin: 0; color: #818995; font-size: .7rem; line-height: 1.8; }

.icon {
  height: 40px;
  width: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.icon svg { width: 24px; height: 24px; }
.icon .project-logo { width: 100%; height: 100%; object-fit: contain; }
.unavailable { background: #fcfcfd; }
.unavailable .project-header, .unavailable .project-description { color: #8a929e; }
.badge {
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: .015em;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.6;
  white-space: nowrap;
}
.wip { color: #717a87; background: #f3f4f6; }
.experimental { color: #88682f; background: #f6f1e7; }
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: .69rem;
  line-height: 1.6;
  color: #818995;
  padding-top: 32px;
  padding-bottom: 28px;
}

@media (max-width: 760px) {
  .page-width { padding-inline: 24px; }
  .header { padding-top: 24px; padding-bottom: 16px; }
  .intro-section { padding-top: 12px; padding-bottom: 28px; }
  .intro-heading-row { align-items: flex-start; flex-direction: column; gap: 20px; margin-bottom: 20px; }
  .carousel-controls { align-self: flex-end; }
  .project-track { --card-width: min(320px, calc(100vw - 64px)); --card-overlap: 36px; --angle-scale: .8; --depth-scale: .7; }
  .project-card { padding: 20px 16px; }
  .project-header { gap: 10px; }
  .project-header .icon { width: 32px; height: 32px; border-radius: 8px; }
  .project-header .icon svg { width: 20px; height: 20px; }
  .project-header h2 { gap: 6px; font-size: 1rem; }
  .product-link { gap: 6px; padding: 8px 10px; font-size: .7rem; }
  .download-controls .download-primary { gap: 6px; padding: 8px 10px; }
  .download-primary svg { width: 14px; height: 14px; }
  .detail-copy { padding-top: 24px; padding-bottom: 12px; }
  .detail-text h2 { font-size: 1.4rem; }
  .detail-text p { font-size: .82rem; }
  .project-body ul { font-size: .82rem; }
  .visual-stage { padding: 24px 24px 32px; }
  .visual-stage::before { height: 320px; background-size: 16px 16px; }
  .screen, .db-models p, .db-spread p { border-radius: 8px; box-shadow: 0 2px 0 #e7ebef, 0 16px 28px -20px #26364640; }
  .footer { font-size: .65rem; }
}

@media (hover: none), (pointer: coarse) {
  .screen.is-tilting { transform: none; }
}

@media (max-width: 600px) {
  .detail-heading:has(.download-controls) { flex-direction: column; align-items: stretch; gap: 16px; }
  .download-controls { grid-template-columns: minmax(0, 1fr); width: min(100%, 170px); }
  .download-feedback { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .github, .project-card, .carousel-arrow, .product-link, .screen, .db-models p, .db-spread p, .download-toggle svg { transition: none; }
  .project-card, .screen.is-tilting, .db-models p:hover, .db-spread p:hover { transform: none; }
  .project-track { scroll-behavior: auto; }
}

@media (forced-colors: active) {
  .icon { outline: 1px solid; }
  .badge { border: 1px solid; }
  .preview-placeholder { border: 1px solid CanvasText; }
  .project-card.is-selected { border: 2px solid Highlight; }
}
