:root {
  --paper: #08090d;
  --ink: #f4f6fb;
  --muted: #9da3b1;
  --line: #2a2f3a;
  --yellow: #2c55ff;
  --yellow-soft: #10172b;
  --dark: #05060a;
  --serif: "Noto Serif SC", serif;
  --sans: "Noto Sans SC", "Manrope", sans-serif;
}

/* Contact poster: preserves the supplied composition without adding page copy. */
.contact-section {
  padding: 0;
  background: #000;
}

.contact-poster {
  display: block;
  width: 100%;
  height: auto;
}

.hero-video {
  min-height: calc(100vh - 78px);
  background: #000;
}

.hero-video video {
  display: block;
  width: 100%;
  height: calc(100vh - 78px);
  object-fit: cover;
}

body,
.sidebar,
.topbar,
.works-section,
.about-section,
.contact-section {
  background: var(--paper);
  color: var(--ink);
}

body {
  cursor: none;
}

.sidebar,
.topbar,
.section-header,
.sidebar-rule,
.filter-row,
.footer,
.contact-links,
.contact-links a,
.skill-strip {
  border-color: var(--line);
}

.brand-mark {
  border-color: var(--ink);
}

.brand-copy strong,
.side-nav a:hover,
.side-nav a.active,
.lang-switch,
.section-index,
.work-meta h3,
.modal-info h2,
.about-statement p,
.contact-copy h2,
.contact-links a,
.contact-form input,
.contact-form textarea,
.contact-form select {
  color: var(--ink);
}

.side-nav a.active,
.side-nav a:hover {
  border-bottom-color: var(--line);
}

.accent,
.side-nav a.active span:first-child,
.project-no,
.timeline-item span,
.serif-lead span,
.works-intro h2 i,
.contact-copy h2 em,
.hero h1 em,
.modal-year {
  color: var(--yellow) !important;
}

.circle-cta:hover,
.floating-note,
.work-arrow,
.filter-btn:hover,
.filter-btn.active,
.submit-btn:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #fff;
}

.status-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(44, 85, 255, 0.18);
}

.hero h1,
.outline-text {
  color: var(--ink);
}

.outline-text {
  -webkit-text-stroke-color: rgba(244, 246, 251, 0.7);
}

.hero-image-frame:before {
  border-color: var(--line);
}

.note-two {
  background: var(--ink);
  color: var(--paper);
}

.note-two strong {
  color: var(--yellow);
}

.about-section {
  background: #0d1017;
}

.about-photo-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.34fr);
  gap: 4vw;
  align-items: end;
  margin-top: 58px;
}

.about-photo {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: #000;
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.about-statement {
  align-self: end;
  border-left: 2px solid var(--yellow);
  padding: 0 0 8px 24px;
}

.about-statement p {
  margin: 0 0 28px;
  font-size: clamp(16px, 1.55vw, 23px);
  line-height: 1.9;
  letter-spacing: -0.03em;
}

.about-statement span {
  color: var(--yellow);
  font: 500 10px var(--mono);
  letter-spacing: 0.1em;
}

.works-section {
  background: var(--paper);
}

.filter-btn {
  border-color: var(--line);
  color: var(--muted);
}

.filter-btn span {
  color: #667084;
}

.work-image {
  background: #11141b;
}

[hidden] {
  display: none !important;
}

.work-card-product .work-image {
  background: #fff;
}

.work-card-product .work-image img {
  object-fit: contain;
  filter: none;
  padding: 0;
}

.work-card-fullbleed .work-image {
  height: auto !important;
  aspect-ratio: 2 / 3;
  background: #05060a;
}

.work-card-fullbleed .work-image img {
  object-fit: cover;
  filter: none;
}

/* 独立站长图只取顶部作为卡片预览，点击后展示完整页面。 */
.work-card-site .work-image {
  height: auto !important;
  aspect-ratio: 16 / 10;
  background: #11141b;
}

.work-card-site .work-image img {
  object-position: center top;
  filter: none;
}

.work-image img {
  filter: grayscale(0.25) saturate(0.8) contrast(1.04);
}

.work-trigger:hover .work-image img {
  filter: grayscale(0) saturate(1) contrast(1.04);
}

.work-arrow {
  color: #fff;
}

.lab-section {
  background: var(--dark);
}

.lab-section .section-header,
.lab-grid {
  border-color: var(--line);
  background: var(--line);
}

.lab-card,
.lab-card.dark-card {
  background: #0b0d12;
}

.lab-card.accent-card {
  background: var(--yellow);
  color: #fff;
}

.lab-card i,
.accent-card i,
.accent-card .lab-number {
  color: #fff;
}

.lab-card p,
.accent-card p {
  color: #aeb6c7;
}

.skill-strip b {
  background: #10131b;
  border-color: var(--line);
}

.contact-section {
  background: #0d1017;
}

.contact-links {
  border-top-color: var(--line);
}

.contact-links a {
  border-bottom-color: var(--line);
}

.contact-form label {
  color: var(--yellow);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  border-bottom-color: var(--line);
  background: transparent;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #687082;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-bottom-color: var(--yellow);
}

.submit-btn {
  background: var(--yellow);
  color: #fff;
}

.submit-btn:hover {
  color: #fff;
}

.footer {
  border-top-color: var(--line);
  color: var(--muted);
}

.modal-content,
.modal-close {
  background: #10131b;
  color: var(--ink);
}

.modal-info p {
  color: var(--muted);
}

.modal-content.is-listing {
  grid-template-columns: minmax(0, 1.38fr) minmax(210px, .62fr);
}

.modal-content.is-listing .modal-media {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 34px;
  min-height: 0;
  max-height: 90vh;
  overflow: auto;
  background: #05060a;
}

.modal-content.is-listing .modal-cover {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: space-between;
  min-height: 300px;
  aspect-ratio: 917 / 513;
  overflow: hidden;
  padding: 22px 26px 25px;
  color: #f4f6fb;
  background: #000;
  border: 1px solid #182039;
}

.modal-content.is-listing .modal-cover::before,
.modal-content.is-listing .modal-cover::after {
  content: '';
  position: absolute;
  width: 13px;
  height: 13px;
  border-color: var(--yellow);
}

.modal-content.is-listing .modal-cover::before {
  top: 12px;
  left: 12px;
  border-top: 1px solid var(--yellow);
  border-left: 1px solid var(--yellow);
}

.modal-content.is-listing .modal-cover::after {
  right: 12px;
  bottom: 12px;
  border-right: 1px solid var(--yellow);
  border-bottom: 1px solid var(--yellow);
}

.cover-topline,
.cover-subtitle,
.cover-caption {
  font-family: var(--mono);
  letter-spacing: .08em;
}

.cover-topline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  color: #a4a9b7;
  font-size: 7px;
  text-align: center;
}

.cover-topline span:first-child {
  text-align: left;
}

.cover-topline span:last-child {
  text-align: right;
}

.cover-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: -2px;
}

.cover-center > img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.cover-title {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  color: #f4f6fb;
  font-family: var(--sans);
  font-size: clamp(17px, 2.5vw, 32px);
  font-weight: 800;
  letter-spacing: -.08em;
  white-space: nowrap;
}

.cover-title i {
  flex: 1;
  height: 1px;
  background: var(--yellow);
}

.cover-title b {
  color: var(--yellow);
  font-weight: 800;
}

.cover-subtitle {
  color: #f4f6fb;
  font-size: 8px;
  letter-spacing: .38em;
}

.cover-caption {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #f4f6fb;
  font-size: 10px;
  font-weight: 600;
}

.cover-caption img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.modal-content.is-listing .modal-gallery-image {
  width: 100%;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
  background: #000;
}

.modal-content.is-listing .modal-gallery-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 0 0 auto;
}

.modal-content.is-listing .modal-gallery-stack img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #000;
  cursor: zoom-in;
}

.modal-content.is-listing #modal-gallery-image,
.modal-content.is-listing #modal-image {
  cursor: zoom-in;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.image-viewer.open {
  opacity: 1;
  pointer-events: auto;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 3, 7, .94);
}

.image-viewer-stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(94vw, 1200px);
  height: min(88vh, 900px);
  overflow: hidden;
  touch-action: none;
}

.image-viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: transform .12s ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.image-viewer-stage img.is-panning {
  cursor: grab;
}

.image-viewer-stage img.is-dragging {
  cursor: grabbing;
  transition: none;
}

.image-viewer-tools,
.image-viewer-close {
  position: absolute;
  z-index: 2;
  color: #f4f6fb;
  border: 1px solid rgba(244, 246, 251, .25);
  background: rgba(16, 19, 27, .88);
  backdrop-filter: blur(12px);
}

.image-viewer-tools {
  bottom: 24px;
  left: 50%;
  display: flex;
  align-items: center;
  transform: translateX(-50%);
}

.image-viewer-tools button,
.image-viewer-close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: inherit;
}

.image-viewer-tools span {
  min-width: 54px;
  text-align: center;
  font: 500 10px var(--mono);
  letter-spacing: .08em;
}

.image-viewer-close {
  top: 22px;
  right: 22px;
  font-size: 19px;
}

/* Full-length product detail pages: preserve every line of text and join pages seamlessly. */
.modal-content.is-listing .modal-gallery-stack[data-layout="connected"] {
  gap: 0;
}

.modal-content.is-listing .modal-gallery-stack[data-layout="connected"] img {
  border-radius: 0;
  object-fit: contain;
}

.modal-content.is-listing .modal-gallery-stack[data-layout="feature"] {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.modal-content.is-listing .modal-gallery-stack[data-layout="grid"] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.modal-content.is-listing .modal-gallery-stack[data-layout="grid"] > img {
  height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.modal-content.is-listing .modal-gallery-stack[data-layout="grid"][data-aspect="landscape"] > img {
  aspect-ratio: 4 / 3;
}

.modal-content.is-listing .modal-gallery-stack[data-layout="grid"][data-aspect="wide"] > img {
  aspect-ratio: 3 / 2;
}

.modal-content.is-listing .modal-gallery-stack[data-layout="feature"] .gallery-featured {
  grid-column: 1 / -1;
}

.modal-content.is-listing .gallery-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.modal-link {
  border-bottom-color: var(--ink);
}

.cursor-dot {
  background: var(--yellow);
}

.cursor-ring {
  border-color: var(--yellow);
  mix-blend-mode: normal;
}

.cursor-ring.hover {
  background: rgba(44, 85, 255, 0.2);
}

.modal-year {
  margin-top: 28px;
  font: 500 9px var(--mono);
  letter-spacing: 0.12em;
}

.image-error {
  visibility: hidden;
}

@media (max-width: 720px) {
  .modal-content.is-listing {
    width: calc(100dvw - 24px);
    max-height: 94dvh;
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .modal-content.is-listing .modal-info {
    padding: 25px 20px 30px;
  }

  .modal-year {
    margin-top: 20px;
    font-size: 8px;
  }

  .about-photo-wrap {
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: stretch;
    margin-top: 38px;
  }

  .about-photo {
    padding: 6px;
  }

  .about-statement {
    border-left: 0;
    border-top: 2px solid var(--yellow);
    padding: 22px 0 0;
  }

  .about-statement p {
    font-size: 15px;
    line-height: 1.85;
  }

  .about-statement span {
    font-size: 8px;
  }

  .mobile-menu {
    background: #05060a;
  }

  .mobile-menu a {
    border-bottom-color: var(--line);
  }

  .modal-content.is-listing .modal-media {
    max-height: none;
    overflow: visible;
    padding: 16px;
    gap: 12px;
  }

  .modal-content.is-listing .modal-cover {
    min-height: 190px;
    padding: 13px 14px 15px;
  }

  .cover-center {
    gap: 8px;
  }

  .cover-center > img {
    width: 30px;
    height: 30px;
  }

  .cover-title {
    gap: 5px;
    font-size: 14px;
  }

  .work-card-fullbleed .work-image {
    aspect-ratio: 2 / 3;
  }

  .cover-subtitle {
    font-size: 5px;
    letter-spacing: .22em;
  }

  .cover-caption {
    font-size: 7px;
  }

  .cover-caption img {
    width: 14px;
    height: 14px;
  }

  .modal-content.is-listing .modal-gallery-stack[data-layout="feature"],
  .modal-content.is-listing .modal-gallery-stack[data-layout="grid"],
  .modal-content.is-listing .gallery-secondary {
    gap: 12px;
  }

  .image-viewer-stage {
    width: 100vw;
    height: 82dvh;
  }

  .image-viewer-tools {
    bottom: 18px;
  }

  .image-viewer-close {
    top: 14px;
    right: 14px;
  }

  .hero-video,
  .hero-video video {
    min-height: calc(100dvh - 58px);
    height: calc(100dvh - 58px);
  }
}

/* 详情信息统一放在全部图片之后，整段内容由弹窗统一滚动，避免文字覆盖作品。 */
.modal-content.is-listing {
  display: flex;
  flex-direction: column;
  width: min(92vw, 930px);
  max-height: 90vh;
  overflow: auto;
}

.modal-content.is-listing .modal-media {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 18px;
  height: auto !important;
  max-height: none;
  overflow: visible;
  padding: 34px;
}

.modal-content.is-listing .modal-info {
  position: static !important;
  inset: auto !important;
  flex: 0 0 auto;
  display: block;
  width: 100%;
  padding: 24px 34px 30px;
  border-top: 1px solid var(--line);
  background: #10131b;
}

.modal-content.is-listing .modal-info h2 {
  margin: 12px 0 14px;
}

.modal-content.is-listing .modal-info p {
  max-width: 680px;
}

/* 首页视频完整显示，窄屏时前景视频按比例缩小，背景只负责填充两侧空间。 */
.hero-video {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(100vh - 78px);
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.hero-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-video-backdrop {
  z-index: 0;
  object-fit: cover !important;
  filter: blur(26px) brightness(.45);
  transform: scale(1.08);
}

.hero-video-main {
  position: relative !important;
  z-index: 1;
  inset: auto !important;
  display: block;
  width: 100%;
  height: auto !important;
  max-width: none;
  max-height: none;
  object-fit: initial !important;
}

/* 视频为 16:9，首页区域直接跟随原始比例，去掉上下多余留白。 */
.hero-video {
  height: auto;
  aspect-ratio: 16 / 9;
}

.hero-video-backdrop {
  display: none;
}

.hero-video video.hero-video-backdrop {
  display: none !important;
}

.hero-video video.hero-video-main {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: initial !important;
}

@media (max-width: 720px) {
  .modal-content.is-listing {
    width: calc(100dvw - 24px);
    max-height: 94dvh;
    overflow: auto;
  }

  .modal-content.is-listing .modal-media {
    height: auto !important;
    min-height: 0 !important;
    padding: 16px;
    gap: 12px;
  }

  .modal-content.is-listing .modal-info {
    padding: 22px 20px 28px;
  }

  .hero-video {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

/* 产品精修封面按原图比例完整展示，避免卡片预览裁掉左右内容。 */
.work-card-cover-contain .work-image {
  height: min(32vw, 340px) !important;
  aspect-ratio: 2 / 3;
  background: #05060a;
}

.work-card-cover-contain .work-image img {
  object-fit: contain;
  filter: none;
}

@media (max-width: 720px) {
  .work-card-cover-contain .work-image {
    height: 65vw !important;
    aspect-ratio: 2 / 3;
  }
}

/* 作品列表封面统一尺寸，避免首张或宽幅项目被放大。 */
.work-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-card-large,
.work-card-wide {
  grid-column: span 1;
}

.work-card .work-image {
  height: min(32vw, 340px) !important;
  aspect-ratio: 2 / 3;
}

.work-card .work-image img {
  object-fit: cover;
}

.work-card-cover-contain .work-image img {
  object-fit: contain;
}

@media (max-width: 720px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-card .work-image {
    height: 65vw !important;
    aspect-ratio: 2 / 3;
  }
}

/* 产品精修与产品结构封面使用原图比例，完整显示图5，不添加上下留白或裁切。 */
.work-card-cover-contain .work-image {
  height: auto !important;
  aspect-ratio: 761 / 517;
}

@media (max-width: 720px) {
  .work-card-cover-contain .work-image {
    height: auto !important;
    aspect-ratio: 761 / 517;
  }
}

/* 产品结构图封面使用原图比例展示：去掉容器上下留白，不裁切、不拉伸内容。 */
.work-card-cover-contain .work-image {
  height: auto !important;
  aspect-ratio: 761 / 517 !important;
  background: transparent !important;
}

.work-card-cover-contain .work-image img {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  filter: none;
}

/* 结构图详情连续拼接，图 5 位于第一张，图片之间不留空隙。 */
.modal-content.is-listing .modal-gallery-stack[data-layout="connected"] {
  gap: 0 !important;
}

.modal-content.is-listing .modal-gallery-stack[data-layout="connected"] > img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  background: transparent !important;
}
