/* ============================================================
   WAREHOUSE ZERO® — Swiss International Style
   Grid / Helvetica-line grotesk / hairline rules / signal red
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Helvetica Neue", Helvetica, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #0a0a0a;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; }
em { font-style: normal; }
sup { font-size: 0.5em; }

::selection { background: #ff0000; color: #ffffff; }

:focus-visible {
  outline: 2px solid #ff0000;
  outline-offset: 3px;
}

/* ---------- Tokens ---------- */
:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --red: #ff0000;
  --gray-500: #6f6f6f;
  --gray-300: #c9c9c9;
  --gray-100: #f0f0f0;
  --invert-line: #2a2a2a;

  --gutter: clamp(20px, 4vw, 64px);
  --gap: clamp(16px, 2vw, 32px);
  --header-h: 68px;

  --ease-out: cubic-bezier(0.22, 0.78, 0.2, 1);
}

/* ---------- Layout primitives ---------- */
.section {
  padding-inline: var(--gutter);
  padding-block: clamp(72px, 10vw, 140px);
  scroll-margin-top: var(--header-h);
}

.section--invert {
  background: var(--black);
  color: var(--white);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--black);
}

.site-header__inner {
  height: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.brand__reg { color: var(--red); margin-left: 1px; }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 36px);
}

.main-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-block: 6px;
  border-bottom: 2px solid transparent;
  transition: color 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
}
.main-nav__no {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.08em;
}
.main-nav__en {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--gray-500);
}
.main-nav a:hover { color: var(--red); }
.main-nav a.is-active {
  color: var(--red);
  border-bottom-color: var(--red);
}
/* 抽屉内的上传入口：桌面隐藏，窄屏显示 */
.main-nav__upload { display: none; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  padding: calc(var(--header-h) + 20px) var(--gutter) 28px;
  max-width: 1680px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 巨字出血裁切 */
}

.meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--black);
}

.hero__title {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(14px, 3vh, 36px);
  /* 纪念碑：上下细线夹住标题区 */
  border-top: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
}

/* ---------- 巨型字满铺（居中纪念碑：双行居中各自满铺） ---------- */
.hero__line {
  display: block;
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: center;
}
.hero__line--main {
  color: var(--black);
  /* 满铺：JS fit-to-width 精确适配，clamp 为兜底 */
  font-size: clamp(3rem, 17.6vw, 20rem);
}
.hero__line--two {
  color: var(--red);
  font-size: clamp(3rem, 37.5vw, 30rem);
  margin-top: -0.06em; /* 行间收紧 */
}
/* 逐字入场 + 指针波载体（JS 驱动 transform/color） */
.hero__line .ltr {
  display: inline-block;
  will-change: transform, color;
  opacity: 0;
  transform: translateY(0.5em);
  transition: transform 0.34s var(--ease-out), color 0.22s linear, opacity 0.34s var(--ease-out);
}
.hero__line.is-in .ltr { opacity: 1; transform: translateY(0); }
@media (hover: hover) {
  .hero__line .ltr:hover { transition-duration: 0.12s; }
}

.hero__mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  background: var(--red);
}

/* 底部：三栏信息（陈述 ｜ 分类导航 ｜ SCROLL） */
.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) auto;
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
  padding-top: 18px;
  border-top: 1px solid var(--black);
}
.hero__foot-line {
  margin: 0;
  font-size: clamp(0.86rem, 1.2vw, 1.05rem);
  font-weight: 500;
  line-height: 1.6;
}

.hero__foot-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-left: 1px solid var(--black);
  padding-left: clamp(18px, 3vw, 40px);
}
.footnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px 8px;
  border: 1px solid var(--black);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  text-align: left;
  transition: color 0.16s var(--ease-out), background 0.16s var(--ease-out);
}
.footnav em { display: none; } /* 横排空间紧凑，隐藏英文 */
.footnav__cn-short { display: none; } /* 桌面端也显示全称 */
.footnav__cn-full { font-weight: 800; }
.footnav b {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--black);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 800;
  flex: none;
  transition: background 0.16s var(--ease-out);
}
.footnav__arrow { font-weight: 800; opacity: 0; transform: translateX(-4px); transition: opacity 0.16s, transform 0.18s var(--ease-out); }
.footnav:hover { color: var(--red); }
.footnav:hover b { background: var(--red); }
.footnav:hover .footnav__arrow { opacity: 1; transform: translateX(0); }

.hero__foot-scroll {
  justify-self: end;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--gray-500);
  transition: color 0.18s var(--ease-out);
}
.hero__foot-scroll:hover { color: var(--red); }
.hero__foot-scroll span {
  display: inline-block;
  animation: scrollNudge 1.8s var(--ease-out) infinite;
}
@keyframes scrollNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ---------- Section header ---------- */
.sec-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 18px;
  padding-bottom: 14px;
  margin-bottom: clamp(40px, 6vw, 80px);
  border-bottom: 1px solid var(--black);
}
.sec-head__no {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--red);
  letter-spacing: 0.08em;
}
.sec-head__label {
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sec-head__label span { font-family: "Noto Sans SC", "PingFang SC", sans-serif; letter-spacing: 0.04em; }
.sec-head__meta {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gray-500);
  text-transform: uppercase;
}

.sec-head--invert { border-bottom-color: var(--white); }

/* ---------- About ---------- */
.about { max-width: 1680px; margin-inline: auto; }

.about__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}

.about__portrait {
  grid-column: 1 / 6;
  align-self: start;
}
.about__portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--gray-100);
}
.about__portrait figcaption {
  margin-top: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.about__content { grid-column: 7 / 13; }

.about__title {
  font-size: clamp(1.7rem, 3.4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}
.about__title em { color: var(--red); }

.about__text {
  max-width: 58ch;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.85;
  color: #242424;
}
.about__text p + p { margin-top: 18px; }

.about__facts {
  margin-top: 44px;
  border-top: 1px solid var(--black);
}
.fact {
  display: grid;
  grid-template-columns: minmax(170px, 240px) 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--black);
}
.fact dt {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-500);
}
.fact dd {
  font-size: 0.95rem;
  font-weight: 700;
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  background: var(--red);
  border-radius: 50%;
}

/* ---------- Work ---------- */
.work { max-width: 1680px; margin-inline: auto; }

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}
.filter {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--black);
  margin-left: -1px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--white);
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
}
.filter:first-child { margin-left: 0; }
.filter__no {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--black);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 800;
  flex: none;
  transition: background 0.18s var(--ease-out);
}
.filter em {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--gray-500);
  font-weight: 700;
  transition: color 0.18s var(--ease-out);
}
.filter__count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--black);
  flex: none;
  font-variant-numeric: tabular-nums;
  transition: color 0.18s var(--ease-out);
}
/* 悬停（未选中）：编号块转红、计数变红，背景仍白 */
.filter:not(.is-active):hover .filter__no { background: var(--red); }
.filter:not(.is-active):hover .filter__count { color: var(--red); }
.filter:not(.is-active):hover em { color: var(--black); }

/* 选中：整格黑底填充，编号红块、计数红字 */
.filter.is-active { background: var(--black); color: var(--white); }
.filter.is-active .filter__no { background: var(--red); color: var(--white); }
.filter.is-active em { color: rgba(255, 255, 255, 0.7); }
.filter.is-active .filter__count { color: var(--red); }

.projects {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(28px, 3.5vw, 56px) var(--gap);
  margin-top: clamp(28px, 4vw, 48px);
}

.project--wide { grid-column: span 7; }
.project--narrow { grid-column: span 5; }

/* Filtered view: uniform rhythm, no ragged holes */
.projects--filtered .project { grid-column: span 6; }
.projects--filtered .project__media { aspect-ratio: 16 / 10; }

.project__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--gray-100);
}
.project--wide .project__media { aspect-ratio: 16 / 10; }
.project--narrow .project__media { aspect-ratio: 4 / 3; }

.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.project:hover .project__media img { transform: scale(1.025); }

.project__badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 10px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--white);
  background: rgba(10, 10, 10, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.project__badge--solid {
  background: var(--red);
  border-color: var(--red);
}

.project__meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px 14px;
  align-items: baseline;
  padding-top: 13px;
  margin-top: 0;
  border-bottom: 1px solid var(--black);
  padding-bottom: 13px;
}
.project__no {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--red);
  transition: transform 0.25s var(--ease-out);
}
.project__title {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 800;
  line-height: 1.3;
}
.project__title em {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--gray-500);
  font-weight: 700;
  margin-top: 3px;
}
.project__cat {
  font-size: 0.78rem;
  font-weight: 600;
  color: #333;
  text-align: right;
}
.project__year {
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}
.project:hover .project__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.project:hover .project__no { transform: translateX(3px); }

.project.is-hiding { opacity: 0; transform: scale(0.985); transition: opacity 0.18s ease, transform 0.18s ease; }
.project.is-hidden { display: none; }

.projects__note {
  margin-top: 40px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* ---------- Long-press to delete ---------- */
.project {
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
/* Press progress: red line fills across media over 600ms */
.project__media::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 3;
}
.project.is-pressing .project__media::after { animation: pressFill 0.6s linear forwards; }
.project.is-pressing .project__media img { filter: grayscale(0.3); }
@keyframes pressFill { to { transform: scaleX(1); } }

/* Confirm overlay */
.project__confirm {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 20px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--black);
}
.project.is-confirm .project__confirm { display: flex; }
.project__confirm-title { font-size: 1.02rem; font-weight: 900; letter-spacing: 0.01em; }
.project__confirm-sub {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
}
.project__confirm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pc-btn {
  padding: 9px 16px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  background: var(--white);
  border: 1px solid var(--black);
  transition: background 0.16s var(--ease-out), color 0.16s var(--ease-out);
}
.pc-btn--del { background: var(--red); border-color: var(--red); color: var(--white); }
.pc-btn--del:hover { background: var(--black); border-color: var(--black); }
.pc-btn--cancel:hover { background: var(--black); color: var(--white); }

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}

.contact__email {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-block: clamp(24px, 3.5vw, 44px);
  border-top: 1px solid var(--invert-line);
  border-bottom: 1px solid var(--invert-line);
  font-size: clamp(1.5rem, 5.2vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  word-break: break-all;
  transition: color 0.2s var(--ease-out);
}
.contact__arrow {
  font-size: 0.8em;
  transition: transform 0.3s var(--ease-out), color 0.2s;
}
.contact__email:hover { color: var(--red); }
.contact__email:hover .contact__arrow { transform: translate(8px, -8px); }

.contact__elsewhere {
  grid-column: 9 / -1;
  margin-top: 32px;
  align-self: start;
}
.contact__elsewhere li { border-bottom: 1px solid var(--invert-line); }
.contact__elsewhere li:first-child { border-top: 1px solid var(--invert-line); }
.contact__elsewhere a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: color 0.18s var(--ease-out);
}
.contact__elsewhere em {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9a9a9a;
}
.contact__elsewhere a:hover { color: var(--red); }
.contact__elsewhere a:hover em { color: var(--red); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--invert-line);
  padding: 22px var(--gutter);
}
.site-footer__inner {
  max-width: 1680px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b5b5b5;
}
.site-footer__mid { color: #6f6f6f; }
.site-footer__top { transition: color 0.18s; }
.site-footer__top:hover { color: var(--red); }

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ============================================================
   V2 — interactive hero / modals / upload
   ============================================================ */

/* ---------- Header upload button ---------- */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--black);
  background: var(--white);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
}
.upload-btn__plus {
  font-size: 1rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  transition: transform 0.25s var(--ease-out), color 0.18s;
}
.upload-btn__en {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--gray-500);
}
/* 观众模式：隐藏所有上传入口（长按删除由 JS 守卫拦截） */
body.is-audience .upload-btn,
body.is-audience .main-nav__upload { display: none !important; }

.upload-btn:hover { background: var(--black); color: var(--white); }
.upload-btn:hover .upload-btn__plus { color: var(--red); transform: rotate(90deg); }
.upload-btn:hover .upload-btn__en { color: var(--white); }

/* ---------- Hero stacking ---------- */
.hero { position: relative; }
.hero__meta, .hero__title, .hero__foot { position: relative; z-index: 1; }
.marquee { position: relative; z-index: 1; }

/* ---------- Red crosshair ---------- */
.crosshair {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.hero:hover .crosshair { opacity: 1; }
.crosshair__v, .crosshair__h { position: absolute; }
.crosshair__v {
  left: 0; top: 0;
  width: 1px; height: 100%;
  background: rgba(255, 0, 0, 0.55);
}
.crosshair__h {
  left: 0; top: 0;
  width: 100%; height: 1px;
  background: rgba(255, 0, 0, 0.55);
}
.crosshair__v::after, .crosshair__h::after {
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  background: var(--red);
}
.crosshair__v::after { top: -3px; left: -3px; }
.crosshair__h::after { left: -3px; top: -3px; }

/* ---------- Marquee ticker ---------- */
.marquee {
  overflow: hidden;
  margin-inline: calc(var(--gutter) * -1);
  margin-top: 22px;
  margin-bottom: -28px;
  background: var(--black);
  color: var(--white);
  border-top: 2px solid var(--red);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marqueeMove 26s linear infinite;
}
.marquee__content {
  flex: none;
  padding: 11px 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-right: 2em;
}
@keyframes marqueeMove {
  to { transform: translateX(-50%); }
}

/* ---------- Modal system ---------- */
body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.22s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal__panel {
  position: relative;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--black);
  box-shadow: 8px 8px 0 rgba(255, 0, 0, 0.35);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: panelIn 0.34s var(--ease-out) both;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(26px) scale(0.985); }
}
.modal__panel--preview { width: min(1080px, 100%); }
.modal__panel--upload { width: min(620px, 100%); }
.modal__panel--auth { width: min(440px, 100%); }

.modal__bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--black);
}
.modal__no {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--red);
  letter-spacing: 0.08em;
}
.modal__counter {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gray-500);
  text-transform: uppercase;
}
.modal__close {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border: 1px solid var(--black);
  transition: background 0.16s, color 0.16s;
}
.modal__close:hover { background: var(--red); border-color: var(--red); color: var(--white); }

/* Preview body */
.modal__body {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  padding: clamp(18px, 3vw, 32px);
}
.modal__info { grid-column: 8 / 13; display: flex; flex-direction: column; }
.modal__title {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 900;
  line-height: 1.25;
}
.modal__en {
  display: block;
  margin-top: 5px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gray-500);
}
.modal__desc {
  margin-top: 20px;
  font-size: 0.9rem;
  line-height: 1.8;
  color: #2b2b2b;
}
.modal__facts {
  margin-top: auto;
  padding-top: 22px;
}
.modal__facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--black);
  font-size: 0.82rem;
  font-weight: 700;
}
.modal__facts dt {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--gray-500);
  text-transform: uppercase;
}
.modal__cta { color: var(--red); font-weight: 800; }

.modal__switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--black);
}
.switch-btn {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 12px;
  border: 1px solid var(--black);
  transition: background 0.16s, color 0.16s;
}
.switch-btn em {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--gray-500);
}
.switch-btn span { font-size: 0.9rem; }
.switch-btn:hover { background: var(--black); color: var(--white); }
.switch-btn:hover em { color: var(--white); }
.modal__switch-hint {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gray-500);
  text-transform: uppercase;
}

/* ---------- Category list modal（双击筛选卡片打开） ---------- */
.modal__panel--cat {
  width: min(880px, 100%);
  display: flex;
  flex-direction: column;
}
.catlist {
  overflow-y: auto;
  max-height: min(62vh, 560px);
  border-top: 1px solid var(--black);
}
.catrow {
  display: grid;
  grid-template-columns: 56px 96px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px clamp(14px, 2.4vw, 22px);
  background: var(--white);
  border: none;
  border-bottom: 1px solid var(--black);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.catrow:hover { background: var(--black); color: var(--white); }
.catrow:hover .catrow__en,
.catrow:hover .catrow__year { color: var(--gray-500); }
.catrow:hover .catrow__arrow { transform: translateX(4px); }
.catrow__no { font-weight: 900; font-size: 0.8rem; color: var(--red); font-variant-numeric: tabular-nums; }
.catrow__thumb {
  width: 96px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--black);
  background: var(--gray-100, #f0f0ee);
}
.catrow__thumb--empty {
  display: grid;
  place-items: center;
  background: var(--black);
  color: var(--white);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.catrow__title { font-weight: 800; font-size: 0.98rem; min-width: 0; }
.catrow__en {
  display: block;
  margin-top: 2px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  text-transform: uppercase;
}
.catrow__year { font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.catrow__arrow { transition: transform 0.16s; }
.catlist__foot {
  padding: 10px clamp(14px, 2.4vw, 22px);
  border-top: 1px solid var(--black);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gray-500);
  text-transform: uppercase;
}
.catlist__empty {
  padding: 34px 22px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--gray-500);
}

/* 分类列表行长按删除 */
.catrow {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.catrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
}
.catrow.is-pressing::after { animation: pressFill 0.6s linear forwards; }
.catrow__confirm {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--red);
  color: var(--white);
}
.catrow.is-confirm .catrow__confirm { display: flex; }
.catrow__confirm-text { font-size: 0.82rem; font-weight: 900; letter-spacing: 0.04em; }
.catrow__confirm .pc-btn { cursor: pointer; border-color: var(--white); }
.catrow__confirm .pc-btn--cancel { color: var(--black); }
.catrow__confirm .pc-btn--cancel:hover { background: var(--black); color: var(--white); border-color: var(--black); }

/* ---------- Upload form ---------- */
.upload-form {
  overflow-y: auto;
  padding: clamp(18px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field { border: none; }
.field > label,
.field > .field__label,
.field > legend {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}
.field em {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  text-transform: uppercase;
}
.field input[type="text"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--black);
  background: var(--white);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 0;
  border-color: var(--red);
}

/* ---------- 作者验证弹窗 ---------- */
.modal__panel--auth .upload-form { padding-top: 0; }

.auth-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  /* 与 .upload-form 的 clamp padding 对齐，顶穿面板边缘 */
  margin: 0 calc(clamp(18px, 3vw, 28px) * -1) 22px;
  padding: 18px clamp(18px, 3vw, 28px);
  border-bottom: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
}
.auth-hero__mark {
  flex: none;
  width: 16px;
  height: 16px;
  background: var(--red);
}
.auth-hero__text { margin-right: auto; }
.auth-hero__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.auth-hero__sub {
  margin: 4px 0 0;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--red);
  font-weight: 700;
}
.auth-hero__no {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  opacity: 0.25;
  line-height: 1;
}

.auth-hint {
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--gray-500);
}
.auth-hint em {
  font-style: normal;
  margin-left: 8px;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
}

/* 验证失败：面板抖动反馈 */
.modal__panel--auth.is-denied { animation: authShake 0.32s var(--ease-out); }
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

.cat-segment { display: flex; }
.cat-seg {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--black);
  margin-left: -1px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--white);
  transition: background 0.16s, color 0.16s;
}
.cat-seg:first-child { margin-left: 0; }
.cat-seg b {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  margin-right: 6px;
  font-size: 0.62rem;
  background: var(--black);
  color: var(--white);
}
.cat-seg.is-active { background: var(--black); color: var(--white); }
.cat-seg.is-active b { background: var(--red); }

/* 特异度需高于 .field > label（0,1,1）才能保持 grid 居中 */
.field > label.file-drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 26px 18px;
  border: 1.5px dashed var(--gray-500);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.file-drop:hover { border-color: var(--red); background: #fff7f7; }
.file-drop__icon {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-bottom: 8px;
  background: var(--red);
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 900;
}
.file-drop small { color: var(--gray-500); font-size: 0.68rem; }
.file-drop__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  line-height: 1.7;
  pointer-events: none;
}
.file-drop__placeholder br { display: none; }
.file-drop__placeholder .file-drop__icon { margin-bottom: 0; }
.file-drop__placeholder #filePhText {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 800;
}
.file-drop__placeholder small {
  display: block;
  margin-top: 3px;
  padding-inline: 8px;
}
.file-drop__preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 全局 img{display:block} 会压过 [hidden]，显式恢复 */
.file-drop__preview[hidden] { display: none; }

.form-error {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red);
}

.submit-btn {
  padding: 15px;
  background: var(--black);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  border: 1px solid var(--black);
  transition: background 0.18s;
}
.submit-btn:hover { background: var(--red); border-color: var(--red); }
.submit-btn__busy { display: none; }
.submit-btn.is-busy { pointer-events: none; background: var(--gray-500); }
.submit-btn.is-busy .submit-btn__busy { display: inline; }
.submit-btn.is-busy .submit-btn__default { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 400;
  transform: translate(-50%, 26px);
  padding: 12px 22px;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--black);
  border-left: 5px solid var(--red);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
  max-width: calc(100vw - 32px);
}
.toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Touch / no-hover: crosshair stays hidden */
@media (hover: none), (pointer: coarse) {
  .crosshair { display: none; }
}

/* V2 reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero__line .ltr { opacity: 1; transform: none; animation: none; }
  .marquee__track { animation: none; }
  .modal__backdrop, .modal__panel { animation: none; }
}

/* ============================================================
   V3 — dot matrix hero / viewers / contact layout / all-interactive
   ============================================================ */

/* ---------- Hero dot matrix canvas ---------- */
.hero__dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.meta-strip__hint {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--gray-500);
}
.meta-strip__hint b {
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

/* ---------- Statement keywords (interactive) ---------- */
.kw {
  display: inline-block;
  font: inherit;
  font-weight: 900;
  padding: 0 0.2em;
  border-bottom: 3px solid var(--black);
  transition: background 0.16s var(--ease-out), color 0.16s var(--ease-out), border-color 0.16s var(--ease-out);
}
.kw:hover {
  background: var(--red);
  border-bottom-color: var(--red);
  color: var(--white);
}

/* ---------- Global micro-interactions ---------- */
.fact { transition: background 0.18s var(--ease-out), padding-left 0.18s var(--ease-out); }
.fact:hover { background: var(--gray-100); padding-left: 10px; }

/* Discipline tags (About) */
.fact__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  padding: 6px 12px;
  border: 1px solid var(--black);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 0.16s var(--ease-out), color 0.16s var(--ease-out);
}
.tag:hover { background: var(--black); color: var(--white); }

/* Availability toggle (About ↔ Contact sync) */
.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid var(--black);
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: background 0.16s var(--ease-out), color 0.16s var(--ease-out);
}
.status-toggle:hover { background: var(--black); color: var(--white); }
/* 观众模式：状态只读，不可点击 */
body.is-audience .status-toggle { cursor: default; }
body.is-audience .status-toggle:hover { background: var(--white); color: inherit; }
.status-toggle__closed { display: none; }
.status-toggle:not(.is-open) .status-toggle__open { display: none; }
.status-toggle:not(.is-open) .status-toggle__closed { display: inline; }
.status-toggle:not(.is-open) .dot { background: var(--gray-500); }
.dot--off { background: var(--gray-500); }

/* Works rows */
.project__meta { transition: background 0.18s var(--ease-out); }
.project:hover .project__meta { background: var(--gray-100); }

.about__portrait img {
  filter: grayscale(1);
  transition: filter 0.5s var(--ease-out);
}
.about__portrait:hover img { filter: grayscale(0); }

.sec-head__no {
  padding: 2px 6px;
  transition: background 0.16s, color 0.16s;
}
.sec-head:hover .sec-head__no { background: var(--red); color: var(--white); }

.marquee:hover .marquee__track { animation-play-state: paused; }

.project__media video,
.project__media canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out);
}
.project:hover .project__media video,
.project:hover .project__media canvas { transform: scale(1.025); }

/* ---------- Preview stage ---------- */
.modal__stage { grid-column: 1 / 8; min-width: 0; }
.viewer { display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }

/* Image viewer */
.viewer__viewport {
  position: relative;
  height: min(58vh, 560px);
  overflow: hidden;
  background: var(--gray-100);
  touch-action: none;
  cursor: grab;
}
.viewer__viewport.is-drag { cursor: grabbing; }
.viewer__viewport img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  max-height: none;
  transform-origin: 0 0;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
}

.viewer__toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
}
.vtool {
  padding: 8px 12px;
  border: 1px solid var(--black);
  background: var(--white);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: background 0.15s, color 0.15s;
}
.vtool:hover { background: var(--black); color: var(--white); }
.vtool[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
.viewer__zoom {
  min-width: 52px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.viewer__hint {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  text-transform: uppercase;
}

/* ---------- Film player (Swiss deck) ---------- */
.player {
  display: flex;
  flex-direction: column;
  background: #000000;
}
.player__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
}
.player__screen canvas,
.player__screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.player__bigplay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
}
.player__bigplay span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--red);
  color: var(--white);
  font-size: 1.35rem;
  transition: transform 0.2s var(--ease-out);
}
.player__bigplay:hover span { transform: scale(1.12); }
.player__bigplay.is-hidden { display: none; }

.player__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #0a0a0a;
  color: var(--white);
}
.pbtn {
  padding: 7px 12px;
  border: 1px solid #3a3a3a;
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.pbtn:hover { background: var(--red); border-color: var(--red); }

.player__progress {
  position: relative;
  flex: 1;
  height: 18px;
  cursor: pointer;
  touch-action: none;
}
.player__progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: #3a3a3a;
}
.player__bar {
  position: absolute;
  left: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  width: 0;
  background: var(--red);
}
.player__head {
  position: absolute;
  left: 0;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  background: var(--red);
}
.player__time {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: #b5b5b5;
  white-space: nowrap;
}
.player:fullscreen {
  width: 100%;
  height: 100%;
  background: #000000;
}
.player:fullscreen .player__screen {
  flex: 1;
  aspect-ratio: auto;
}

/* ---------- 3D wireframe viewer ---------- */
.modelwrap {
  position: relative;
  height: min(58vh, 560px);
  background: #0a0a0a;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.modelwrap.is-drag { cursor: grabbing; }
#modelCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Contact V3 layout ---------- */
.contact__inner { max-width: 1680px; margin-inline: auto; }
.contact { padding-bottom: clamp(40px, 5vw, 64px); } /* 底部留白压缩，其余板块不变 */

.contact__layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  margin-top: clamp(32px, 5vw, 56px);
}
.contact__main {
  grid-column: 1 / 8;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.contact__side {
  grid-column: 8 / 13;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* minmax(0,·) 保证两列真等宽 */
  align-content: start;
  border-top: 1px solid var(--invert-line);
  border-left: 1px solid var(--invert-line);
}
.cinfo {
  padding: 20px;
  border-right: 1px solid var(--invert-line);
  border-bottom: 1px solid var(--invert-line);
  transition: background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.cinfo:hover { background: #141414; box-shadow: inset 0 0 0 1px var(--red); }
.cinfo h3 {
  margin-bottom: 12px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #9a9a9a;
  text-transform: uppercase;
}
.cinfo p { font-size: 0.9rem; font-weight: 600; line-height: 1.7; }
.cinfo__clock { font-variant-numeric: tabular-nums; color: var(--red); font-weight: 800; }
.cinfo .contact__elsewhere { margin-top: 0; }

/* IP geolocation block */
.cinfo--loc .loc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  font-size: 0.86rem;
  line-height: 1.55;
}
.cinfo--loc .loc-k {
  flex: none;
  width: 78px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #9a9a9a;
}
.loc-coord { font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.loc-sub { margin-top: 10px; font-size: 0.76rem; color: #9a9a9a; }

/* Contact side: 2×2 grid — SOCIAL | STUDIO / HOURS | STATUS */

.soc {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  transition: color 0.16s var(--ease-out), padding-left 0.16s var(--ease-out);
}
.soc em {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9a9a9a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 2×2 半列空间下账号完整显示：名称与账号上下两行 */
.cinfo--social .soc {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.soc:hover { color: var(--red); padding-left: 8px; }
.soc:hover em { color: var(--red); }

/* ---------- Upload: media previews ---------- */
.file-drop__preview--dark { background: #0a0a0a; }

/* ============================================================
   V4 — 三端自适应（PC ≥1024 / 平板 768–1023 / 手机 ≤767）
   ============================================================ */

/* Hamburger button — hidden on PC */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 9px;
  border: 1px solid var(--black);
  background: var(--white);
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--black);
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

body.nav-open { overflow: hidden; }
.nav-scrim {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 98;
  background: rgba(10, 10, 10, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}
.nav-scrim.is-open { opacity: 1; pointer-events: auto; }

/* ---------- 平板 + 手机 共通（≤1023） ---------- */
@media (max-width: 1023px) {
  :root { --header-h: 60px; }

  .section { padding-block: clamp(56px, 8vw, 96px); }

  /* Nav becomes a right drawer */
  .nav-toggle { display: inline-flex; }
  .upload-btn { display: none; } /* 平板/手机：上传入口在抽屉菜单内 */

  .main-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    /* header 的 backdrop-filter 使其成为 fixed 包含块，bottom:0 会把高度压成 0 —— 改用显式高度 */
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    width: min(78vw, 320px);
    background: var(--white);
    border-left: 1px solid var(--black);
    transform: translateX(100%);
    transition: transform 0.32s var(--ease-out);
    z-index: 99;
    overflow-y: auto;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0;
  }
  .main-nav li { border-bottom: 1px solid var(--gray-100); }
  .main-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 17px 24px;
    font-size: 0.95rem;
    border-bottom: none;
  }
  .main-nav__no { font-size: 0.72rem; align-self: center; }
  .main-nav__cn { font-size: 1.02rem; margin-right: auto; margin-left: 4px; }
  .main-nav__en { font-size: 0.64rem; align-self: center; }

  /* 抽屉上传按钮：与导航项同构，红色突出 */
  .main-nav__upload { display: block; }
  .main-nav__upload-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 17px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--red);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: color 0.18s var(--ease-out), padding-left 0.18s var(--ease-out);
  }
  .main-nav__upload-btn:hover { color: var(--black); padding-left: 30px; }
  .main-nav__upload-btn .main-nav__no { color: var(--red); }
  .main-nav__upload-btn .main-nav__en { color: inherit; }

  /* Hero bottom stacks */
  /* About：content 拆盒（display:contents），子项直接参与 12 列网格；
     手机单列时按 DOM 序 portrait → title → text → facts 自然堆叠 */
  .about__portrait { grid-column: 1 / -1; max-width: 440px; }
  .about__content { display: contents; }
  .about__title,
  .about__text,
  .about__facts { grid-column: 1 / -1; }

  /* Works: two columns */
  .project--wide,
  .project--narrow { grid-column: span 6; }
  .project--wide .project__media,
  .project--narrow .project__media { aspect-ratio: 16 / 10; }
  .projects--filtered .project { grid-column: span 6; }

  /* Filters: four equal cells with a closed border box */
  .filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-right: 1px solid var(--black);
    border-bottom: 1px solid var(--black);
  }
  .filter {
    width: 100%;
    margin: 0;
    padding-inline: 12px;
    justify-content: flex-start;
    border: none;
    border-left: 1px solid var(--black);
    border-top: 1px solid var(--black);
  }

  /* Contact stacks */
  .contact__main { grid-column: 1 / -1; }
  .contact__side { grid-column: 1 / -1; }

  /* Preview modal: stage over info */
  .modal__stage { grid-column: 1 / -1; }
  .modal__info { grid-column: 1 / -1; }
  .modal__facts { margin-top: 20px; }
  .modal__switch-hint { display: none; }
}

/* ---------- 平板专属（768–1023） ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .viewer__viewport,
  .modelwrap { height: min(52vh, 480px); }

  .filter em { display: none; }

  /* About：肖像左 5 列跨标题+正文两行，文字右 7 列，FACTS 整行下铺 */
  .about__portrait { grid-column: 1 / 6; grid-row: span 2; max-width: none; }
  .about__title { grid-column: 7 / 13; font-size: clamp(1.5rem, 3.6vw, 2.4rem); }
  .about__text { grid-column: 7 / 13; }
  .fact { grid-template-columns: minmax(0, 150px) 1fr; gap: 14px; }

  /* Hero 底部：分类导航独占整行，三卡等宽不再被挤压 */
  .hero__foot { grid-template-columns: 1fr; gap: 16px; }
  .hero__foot-nav {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--black);
    padding-top: 12px;
  }
  .hero__foot-scroll { justify-self: start; }
}

/* ---------- 桌面（≥1024） ---------- */
@media (min-width: 1024px) {
  /* About 肖像拉伸至右列最低点：底边与 FACTS 对齐，不再超出右列 */
  .about__portrait {
    position: relative;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 0;
  }
  .about__portrait img {
    position: absolute; /* 脱离文档流：固有高度不参与网格行高，行高完全由右列决定 */
    top: 0;
    left: 0;
    width: 100%;
    /* 替换元素 height:auto 取内在高度，须显式计算填充（预留 figcaption 约 24px） */
    height: calc(100% - 24px);
    aspect-ratio: auto;
  }

  /* About 下方留白收紧（全局 .section 为 clamp(72px,10vw,140px)，下边单独调小） */
  .about { padding-bottom: clamp(56px, 7vw, 96px); }
}

/* ---------- 手机（≤767） ---------- */
@media (max-width: 767px) {
  :root { --header-h: 56px; }

  /* Header compact */
  .site-header__inner { gap: 12px; }

  /* Meta strip wraps */
  .meta-strip {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px 14px;
    font-size: 0.62rem;
  }
  .meta-strip .meta-strip__hide-mobile,
  .meta-strip__hint { display: none; }

  /* Hero compact */
  .hero { padding-bottom: 20px; }
  .hero__foot { grid-template-columns: 1fr; gap: 14px; }
  /* 三分类：横向三等格卡片 */
  .hero__foot-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--black);
    padding-top: 12px;
  }
  .footnav {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 10px 13px;
    border: 1px solid var(--black);
  }
  .footnav b {
    width: 22px;
    height: 22px;
    font-size: 0.66rem;
    transform: none;
    margin-bottom: 6px;
    background: var(--red);
  }
  .footnav__cn-short { display: none; }
  .footnav__cn-full {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.2;
  }
  .footnav em {
    display: block;
    font-size: 0.5rem;
    letter-spacing: 0.1em;
  }
  .footnav__arrow { display: none; }
  .footnav:active { background: var(--black); color: var(--white); }
  .footnav:active b { background: var(--red); }
  .footnav:active em { color: var(--white); }
  .hero__foot-scroll { display: none; }

  /* Discipline rows removed in V7 满铺重构 */

  /* Facts stack */
  .fact { grid-template-columns: 1fr; gap: 6px; }
  .status-toggle { width: 100%; justify-content: flex-start; }

  /* Section head：标题不折行（防“作品集”孤字），隐藏右侧 meta 让位 */
  .sec-head { gap: 10px; }
  .sec-head__label { white-space: nowrap; }
  .sec-head__meta { display: none; }

  /* Filters: 2 × 2 */
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 2×2 合并边框：取消统一负边距，只让右列左叠、下行上叠 */
  .filter {
    margin: 0;
    padding-inline: 10px;
    gap: 8px;
    white-space: nowrap;
  }
  /* 手机端隐藏英文（同平板），保证“编号+中文+计数”单行 */
  .filter em { display: none; }
  .filter:nth-child(even) { margin-left: -1px; }
  .filter:nth-child(n + 3) { margin-top: -1px; }

  /* Category list: hide thumbs, keep compact rows */
  .catrow { grid-template-columns: 44px minmax(0, 1fr) auto 18px; gap: 12px; }
  .catrow__thumb { display: none; }

  /* Works: single column */
  .project--wide,
  .project--narrow,
  .projects--filtered .project { grid-column: 1 / -1; }
  .project__meta {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "no title year"
      "no cat year";
    gap: 4px 12px;
  }
  .project__no { grid-area: no; align-self: start; }
  .project__title { grid-area: title; min-width: 0; }
  .project__cat { grid-area: cat; text-align: left; }
  .project__year { grid-area: year; align-self: start; }

  /* Contact side: single column */
  .contact__side { grid-template-columns: 1fr; }

  /* Modals go fullscreen */
  .modal { padding: 0; }
  .modal__panel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: none;
    box-shadow: none;
  }
  .modal__body { flex: 1; min-height: 0; }
  .modal__bar { gap: 8px; padding: 11px 14px; }
  .modal__close { padding: 5px 7px; }
  .modal__switch { padding: 10px 14px; flex-wrap: wrap; }

  /* Viewers */
  .viewer__viewport,
  .modelwrap { height: 42vh; }
  .viewer__hint { display: none; }

  /* Player controls wrap */
  .player__controls { flex-wrap: wrap; }
  .player__progress { flex-basis: 100%; order: 5; }
  .player__time { margin-left: auto; }

  /* Footer compact */
  .site-footer__mid { display: none; }
}

/* ---------- 超小屏（≤380） ---------- */
@media (max-width: 380) {
  .main-nav { width: 86vw; }
  .brand { font-size: 0.92rem; }
}

/* ============================================================
   404 / NOT FOUND — Swiss composition
   ============================================================ */
.nf {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.nf__net {
  color: var(--red);
  font-weight: 700;
}

.nf__meta { flex: 0 0 auto; }

/* 巨型 404：满铺出血（字号由 JS Range 测量精确设定），黑/红/黑对应主站双色排版 */
.nf__giant {
  flex: 0 0 auto;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  font-weight: 900;
  line-height: 0.92;
  font-size: 6rem; /* 初始值，fitNf() 立即覆盖 */
  letter-spacing: -0.045em;
  padding: clamp(24px, 4vw, 48px) 0 clamp(20px, 3vw, 40px);
}
.nf__digit {
  display: inline-block;
  transition: transform 0.35s var(--ease-out), color 0.35s var(--ease-out);
  will-change: transform;
}
.nf__digit--b { color: var(--black); }
.nf__digit--r { color: var(--red); }
.nf__digit:hover {
  transform: translateY(-0.08em);
}
.nf__digit--b:hover { color: var(--red); }
.nf__digit--r:hover { color: var(--black); transform: translateY(-0.08em) rotate(-2deg); }

/* 陈述 + 操作：网格分栏 */
.nf__grid {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 60px) var(--gutter) clamp(32px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

.nf__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.nf__title {
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.nf__title-red { color: var(--red); }
.nf__sub {
  font-size: clamp(0.86rem, 1vw, 0.98rem);
  color: var(--gray-500);
  line-height: 1.7;
  max-width: 52ch;
}

/* 操作按钮 */
.nf__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nf-btn {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--black);
  text-align: left;
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
}
.nf-btn__no {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  background: var(--red);
  color: var(--white);
}
.nf-btn__cn { font-weight: 700; font-size: 0.95rem; }
.nf-btn__en {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  transition: color 0.25s var(--ease-out);
}
.nf-btn--primary { background: var(--black); color: var(--white); }
.nf-btn--primary .nf-btn__en { color: rgba(255, 255, 255, 0.65); }
.nf-btn--primary:hover { background: var(--red); border-color: var(--red); transform: translateX(4px); }
.nf-btn--primary:hover .nf-btn__no { background: var(--black); }
.nf-btn--primary:hover .nf-btn__en { color: rgba(255, 255, 255, 0.85); }
.nf-btn--ghost:hover { background: var(--black); color: var(--white); transform: translateX(4px); }
.nf-btn--ghost:hover .nf-btn__en { color: rgba(255, 255, 255, 0.75); }
.nf-btn:active { transform: translateX(2px) scale(0.995); }

/* 网络波动跑马灯：顶部白底向右 / 底部黑底向左 */
.nf__grid { flex: 1 1 auto; }

.nfmq {
  flex: 0 0 auto;
  overflow: hidden;
  white-space: nowrap;
}
.nfmq__track {
  display: flex;
  width: max-content;
  padding: 12px 0;
}
.nfmq__group {
  flex: none;
  display: flex;
  align-items: center;
}
.nfmq__txt,
.nfmq__num {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0 1.5em;
}
.nfmq__mark {
  flex: none;
  width: 9px;
  height: 9px;
  background: var(--red);
}

/* 顶部：白底黑字、1px 下细线，向右 */
.nfmq--top {
  background: var(--white);
  color: var(--black);
  border-bottom: 1px solid var(--black);
}
.nfmq--top .nfmq__num { color: var(--red); }
.nfmq__track--right { animation: nfmqRight 30s linear infinite; }
@keyframes nfmqRight {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* 底部：黑底白字、红色上细线，向左（同主站 marquee 语言） */
.nfmq--bottom {
  background: var(--black);
  color: var(--white);
  border-top: 2px solid var(--red);
}
.nfmq--bottom .nfmq__num { color: var(--red); }
.nfmq__track--left { animation: nfmqLeft 30s linear infinite; }
@keyframes nfmqLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.nfmq:hover .nfmq__track { animation-play-state: paused; }

.nf__foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--gutter);
  border-top: 1px solid var(--black);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}

/* ---------- 404 平板（768–1023） ---------- */
@media (max-width: 1023px) {
  .nf__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .nf__actions { flex-direction: row; }
  .nf-btn { flex: 1; grid-template-columns: auto 1fr; }
  .nf-btn__en { display: none; }
}

/* ---------- 404 手机（≤767） ---------- */
@media (max-width: 767px) {
  .nf__actions { flex-direction: column; }
  .nf-btn__en { display: block; }
  .nfmq__txt,
  .nfmq__num { font-size: 0.66rem; padding: 0 1.1em; }
  .nfmq__mark { width: 7px; height: 7px; }
  .nf__foot { flex-wrap: wrap; gap: 6px; }
}

/* ---------- 404 减弱动效：跑马灯静止呈现 ---------- */
@media (prefers-reduced-motion: reduce) {
  .nfmq__track--left,
  .nfmq__track--right { animation: none; }
}
