:root {
  color-scheme: light;
  color: var(--ink);
  background: var(--paper);
  font-family: 'PingFang SC', 'Microsoft YaHei UI', 'Noto Sans CJK SC', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  scroll-behavior: smooth;
  scroll-padding-block-start: 20px;
  --ink: #142c24;
  --muted: #52645b;
  --accent: #165c47;
  --accent-hover: #104433;
  --deep: #123b30;
  --mint: #e5f0e8;
  --paper: #f5f7f3;
  --surface: #fff;
  --line: #d6e2d9;
  --ring: #17775d;
  --content: 1200px;
  --gutter: clamp(18px, 4vw, 44px);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body,
figure,
h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

body.dialog-open {
  overflow: hidden;
}

::selection {
  color: var(--ink);
  background: #c7e5d5;
}

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

:where(button, a) {
  touch-action: manipulation;
}

h1,
h2,
h3 {
  line-height: 1.25;
  text-wrap: balance;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 5;
  padding: 10px 16px;
  color: var(--surface);
  background: var(--accent);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: min(var(--content), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.header {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px max(var(--gutter), calc((100% - var(--content)) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.identity {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 44px;
  font-size: 19px;
}

.identity-mark {
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--deep);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-family: 'Songti SC', SimSun, serif;
  font-size: 20px;
  font-weight: 700;
}

.header nav,
.footer-links {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  flex-wrap: wrap;
}

.header nav a,
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.header nav a:hover,
.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.header > button {
  justify-self: end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.button-dark {
  color: var(--surface);
  background: var(--accent);
}

.button-dark:hover {
  background: var(--accent-hover);
}

.button-outline {
  border-color: var(--line);
  color: var(--accent);
  background: var(--surface);
}

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

.text-link,
.gallery-meta a,
.contact-qr a,
.contact-steps > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: #9bb7a8;
  text-underline-offset: 5px;
}

.text-link:hover,
.gallery-meta a:hover,
.contact-qr a:hover,
.contact-steps > a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  padding-block: clamp(42px, 6vw, 72px);
}

.intro h1 {
  font-family: 'Noto Serif CJK SC', 'Songti SC', SimSun, serif;
  font-size: clamp(34px, 3.8vw, 60px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.intro-text {
  max-width: 31em;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 18px);
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-block: 24px 20px;
}

.intro-actions .button {
  padding-inline: 20px;
}

.intro-meta {
  color: var(--muted);
  font-size: 13px;
}

.intro-visual {
  position: relative;
  min-width: 0;
  padding: clamp(16px, 4.4vw, 58px);
  padding-bottom: clamp(40px, 6.4vw, 82px);
  overflow: hidden;
  border-radius: 16px;
  background: var(--deep);
}

.visual-main,
.visual-secondary {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 12px 28px #061d1766;
}

.visual-main {
  width: 90%;
}

.visual-secondary {
  position: absolute;
  right: clamp(12px, 4vw, 50px);
  bottom: clamp(56px, 7vw, 82px);
  width: 43%;
}

.intro-visual img {
  width: 100%;
  height: auto;
}

.intro-visual figcaption {
  position: absolute;
  inset: auto 14px 10px;
  color: #d7e8de;
  font-size: clamp(11px, 1.2vw, 13px);
}

@media (min-width: 960px) {
  .intro-visual figcaption {
    inset: auto 50px 19px;
  }
}

.catalog-section {
  padding-block: clamp(38px, 5vw, 60px);
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px 24px;
}

.section-head h2,
.delivery h2,
.notes h2 {
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.025em;
}

.section-head p,
.delivery-intro p {
  margin-top: 8px;
  color: var(--muted);
}

.catalog-count {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 13px;
}

.catalog-count strong {
  margin-right: 2px;
  color: var(--accent);
  font-size: 22px;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-block: 22px 24px;
  padding-block: 12px;
  border-block: 1px solid var(--line);
}

.filter-list,
.gallery-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.filter-list button,
.gallery-options button {
  min-height: 44px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.filter-list button:hover,
.gallery-options button:hover {
  border-color: var(--line);
  color: var(--accent);
  background: var(--paper);
}

.filter-list button[aria-pressed='true'],
.gallery-options button[aria-pressed='true'] {
  color: var(--deep);
  background: var(--mint);
  border-color: #a5c7b4;
}

.search {
  display: flex;
  flex: 1 1 270px;
  align-items: center;
  max-width: 370px;
  min-width: 0;
  min-height: 46px;
  gap: 10px;
  border: 1px solid #a8bbae;
  border-radius: 8px;
  background: var(--surface);
  padding-inline: 13px;
}

.search:focus-within {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.search input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  caret-color: var(--accent);
}

.search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search kbd {
  border-radius: 4px;
  padding-inline: 7px;
  color: var(--muted);
  background: var(--paper);
  font-size: 12px;
}

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

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-card:hover,
.project-card:focus-within {
  border-color: #98b8a6;
}

.project-cover {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: var(--mint);
}

.project-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 180ms ease-out;
}

@media (hover: hover) {
  .project-cover:hover .project-image {
    transform: scale(1.025);
  }
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 17px 18px 10px;
}

.card-top,
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-category {
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--deep);
  background: var(--mint);
  font-size: 12px;
  font-weight: 700;
}

.card-index,
#detail-code {
  color: var(--accent);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.card-body h3 {
  margin-top: 11px;
  font-size: clamp(16px, 1.9vw, 20px);
}

.card-summary {
  flex: 1;
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.card-bottom {
  border-top: 1px solid var(--line);
  padding-top: 3px;
}

.card-stack {
  color: var(--muted);
  font-size: 13px;
}

.card-detail {
  min-height: 44px;
  margin-right: -6px;
  padding: 0 6px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.card-detail:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.empty {
  padding: 28px;
  border: 1px dashed #a8bbae;
  border-radius: var(--radius);
  background: var(--paper);
}

.empty p {
  margin: 6px 0 14px;
  color: var(--muted);
}

.delivery,
.notes-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 7vw, 92px);
  padding-block: clamp(42px, 7vw, 88px);
}

.delivery-items {
  border-top: 1px solid var(--line);
}

.delivery-items article {
  padding-block: 13px 17px;
  border-bottom: 1px solid var(--line);
}

.delivery-items h3 {
  font-size: 17px;
}

.delivery-items p {
  margin-top: 5px;
  color: var(--muted);
}

.notes {
  color: #f3f8f4;
  background: var(--deep);
}

.notes-copy {
  color: #ddeae2;
}

.notes-copy > p + p {
  margin-top: 12px;
}

.status-line {
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid #628675;
}

.status-line b,
.status-line small {
  display: block;
}

.status-line small {
  margin-top: 4px;
  font-size: 14px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-block: 16px;
}

dialog {
  max-width: calc(100% - 24px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: #0c241cba;
}

.detail-dialog {
  width: 1040px;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

.detail-scroll {
  max-height: min(900px, calc(100dvh - 24px));
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block-start: 70px;
}

.detail-top,
.contact-top,
.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.detail-top {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

#close-detail,
#close-contact,
#close-lightbox {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--accent);
  background: var(--surface);
  font-size: 26px;
  line-height: 1;
}

#close-detail:hover,
#close-contact:hover,
#close-lightbox:hover {
  border-color: var(--line);
  background: var(--mint);
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: start;
  gap: 26px 28px;
  padding: clamp(16px, 4.3vw, 38px);
}

.detail-intro {
  grid-column: 1 / -1;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

#detail-category {
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--deep);
  background: var(--mint);
  font-weight: 700;
}

.detail-intro h2 {
  margin-top: 8px;
  font-size: clamp(23px, 4vw, 38px);
  letter-spacing: -0.025em;
}

.detail-summary {
  margin-top: 8px;
  color: var(--muted);
}

.detail-preview h3,
.detail-info h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.preview-button {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.preview-button img {
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: contain;
}

.preview-button span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--surface);
  background: var(--deep);
  font-size: 12px;
}

.preview-button:hover span {
  background: var(--accent);
}

.gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.gallery-meta p,
.lightbox-toolbar > span {
  overflow-wrap: anywhere;
}

.gallery-meta a {
  flex-shrink: 0;
}

.gallery-options {
  gap: 5px;
}

.gallery-options button {
  border-color: var(--line);
  font-size: 13px;
}

.detail-info {
  min-width: 0;
}

.detail-info > * + * {
  margin-top: 24px;
}

.detail-info ul {
  margin: 0;
  padding-inline-start: 1.15em;
  color: var(--muted);
}

.detail-info li + li {
  margin-top: 7px;
}

.tech-specs {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 14px;
  padding-block: 10px;
  border-block: 1px solid var(--line);
  font-size: 14px;
}

.tech-specs dt {
  color: var(--muted);
}

.tech-specs dd {
  font-weight: 650;
  overflow-wrap: anywhere;
}

#detail-technical {
  margin-top: 11px;
  color: var(--muted);
}

.scope {
  padding: 12px 15px;
  border-radius: 9px;
  background: var(--paper);
}

.scope h3 {
  margin-bottom: 5px;
  font-size: 15px;
}

.scope p {
  color: var(--muted);
  font-size: 14px;
}

.lightbox {
  width: 1440px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

.lightbox-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 650;
}

.lightbox-toolbar div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.lightbox-toolbar .button {
  padding-inline: 11px;
}

.lightbox img {
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 100px);
  object-fit: contain;
  background: var(--deep);
}

.contact-dialog {
  width: 660px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

.contact-top {
  align-items: flex-start;
  padding: 16px 18px;
}

.contact-top h2 {
  font-size: clamp(19px, 4vw, 25px);
}

.contact-top p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.contact-content {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 20px;
  padding: 18px;
}

.contact-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-qr img {
  width: min(100%, 210px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-qr a,
.contact-steps {
  font-size: 14px;
}

.contact-steps h3 {
  margin: 4px 0 15px;
}

.contact-steps label {
  display: block;
  font-weight: 650;
}

.contact-label,
#general-contact,
.contact-steps ol {
  color: var(--muted);
}

.copy-row {
  display: flex;
  gap: 7px;
}

.copy-row input {
  width: 100%;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid #a8bbae;
  border-radius: 7px;
  background: var(--paper);
}

.copy-status {
  margin-top: 5px;
  color: var(--accent);
}

.contact-steps ol {
  padding-inline-start: 1.4em;
}

.contact-steps li + li {
  margin-top: 6px;
}

@media (max-width: 930px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header {
    min-height: 64px;
    grid-template-columns: auto 1fr;
  }

  .header nav {
    display: none;
  }

  .intro,
  .delivery,
  .notes-inner,
  .detail-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .intro {
    gap: 24px;
  }

  .intro h1 {
    font-size: clamp(32px, 8vw, 52px);
  }

  .intro-text {
    margin-top: 13px;
  }

  .intro-actions {
    margin-block: 17px 10px;
  }

  .visual-secondary {
    bottom: 43px;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    flex: none;
    max-width: none;
  }

  .search kbd {
    display: none;
  }

  .detail-body {
    gap: 18px;
  }
}

@media (max-width: 520px) {
  .grid,
  .contact-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-head {
    align-items: flex-start;
  }

  .catalog-count {
    margin-top: 0;
  }

  .contact-qr img {
    width: min(100%, 165px);
  }

  .footer-links {
    column-gap: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  .project-image {
    transition: none;
  }

  .project-cover:hover .project-image {
    transform: none;
  }
}
