/* ============================================================
   Fang Dian — Ink & Motion
   设计方向：创意工作室作品集 × 学术内核
   约束：CSP style-src 'self'（无内联样式）、零依赖、自托管字体
   ============================================================ */

/* ---------- 字体（自托管拉丁子集，中文走系统栈） ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/BricolageGrotesque-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/InstrumentSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- 设计 Token ---------- */
:root {
  color-scheme: light;

  --paper: #f4f1ea;
  --paper-2: #ece8dd;
  --ink: #141412;
  --ink-2: #6e6a60;
  --line: #d8d3c6;
  --accent: #e8442e;
  --accent-deep: #c73521;
  --dark: #121210;
  --dark-2: #1c1b18;
  --dark-line: #2e2c26;
  --dark-ink: #f2efe7;
  --dark-ink-2: #9b968a;

  --font-display: "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Songti SC", serif;
  --font-mono: "IBM Plex Mono", "Consolas", "Courier New", monospace;
  --font-cjk: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);

  --gutter: clamp(20px, 6vw, 96px);
}

/* 摄影页整体换暗色 */
body.page-gallery {
  color-scheme: dark;
  --paper: #121210;
  --paper-2: #1c1b18;
  --ink: #f2efe7;
  --ink-2: #9b968a;
  --line: #2e2c26;
  --surface: #1c1b18;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

/* ---------- 基础 ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-cjk);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 全站噪点颗粒（CSP 允许 data: 图像） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9995;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

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

h1,
h2,
h3,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: top 0.25s var(--ease-out);
}

.skip-link:focus {
  top: 16px;
}

/* 链接下划线动画 */
.u-line {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease-out);
  padding-bottom: 2px;
}

.u-line:hover,
a:hover > .u-line,
.u-line:focus-visible {
  background-size: 100% 1px;
}

/* ---------- 自定义光标（JS 启用 html.has-cursor） ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
}

.cursor-dot {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: var(--accent);
}

.cursor-ring {
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 1px solid color-mix(in srgb, var(--ink) 55%, transparent);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
    margin 0.3s var(--ease-out), border-color 0.3s, background-color 0.3s,
    opacity 0.3s;
}

html.has-cursor .cursor-dot,
html.has-cursor .cursor-ring {
  opacity: 1;
}

html.has-cursor .cursor-ring.cursor-hover {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

@media (pointer: fine) {
  html.has-cursor body,
  html.has-cursor a,
  html.has-cursor button,
  html.has-cursor .research-row,
  html.has-cursor .masonry figure {
    cursor: none;
  }
}

/* ---------- 头部 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 28px;
  padding: 18px var(--gutter);
  transition: transform 0.45s var(--ease-out), background-color 0.35s,
    border-color 0.35s, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.site-header.hide {
  transform: translateY(-100%);
}

body.page-gallery .site-header.scrolled {
  background: color-mix(in srgb, #121210 82%, transparent);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand span:first-child {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.brand span:last-child {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-2);
  font-size: 1.02rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--ink-2);
}

.nav-links a {
  transition: color 0.25s;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  color: var(--accent);
}

.lang-toggle {
  width: 52px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  min-height: 100svh;
  padding: 130px var(--gutter) 150px;
  overflow: hidden;
}

/* 巨型轮廓水印字 */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  will-change: transform;
}

.hero-watermark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(6rem, 17vw, 17rem);
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--ink) 14%, transparent);
  letter-spacing: 0.02em;
  user-select: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-side {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(100%, 400px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 26px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}

.eyebrow::before {
  content: "✳";
  color: var(--accent);
  font-size: 0.9rem;
}

.hero-name {
  position: relative;
  margin: 0;
  line-height: 1;
}

.hero-name-zh {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4.6rem, 13vw, 12.5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
}

.hero-name-en {
  display: block;
  margin-top: clamp(-1.6rem, -2.5vw, -0.9rem);
  margin-left: clamp(1.2rem, 6vw, 5.5rem);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 1.1;
  color: var(--accent);
  transform: rotate(-2.5deg);
}

.hero-text {
  max-width: 560px;
  margin-top: 34px;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 1.6vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 42px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.3s var(--ease-out), color 0.3s, border-color 0.3s,
    transform 0.3s var(--ease-out);
}

.button .arr {
  display: inline-block;
  transition: transform 0.3s var(--ease-out);
}

.button:hover .arr {
  transform: translateX(5px);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  transform: translateY(-2px);
}

.button.secondary {
  background: transparent;
  color: var(--ink);
}

.button.secondary:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

/* 拱门头像 + 偏移描边框 */
.portrait-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px 20px 20px;
  padding: 12px;
  background: var(--paper);
  will-change: transform;
}

.portrait-wrap::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 999px 999px 12px 12px;
  transform: translate(14px, 14px);
  z-index: -1;
}

.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px 999px 10px 10px;
  filter: contrast(1.03) saturate(0.95);
}

/* 旋转环形文字徽章 */
.badge-wrap {
  position: absolute;
  right: clamp(-30px, -2vw, -12px);
  bottom: -34px;
  width: clamp(96px, 10vw, 132px);
  aspect-ratio: 1;
}

.badge {
  display: block;
  width: 100%;
  height: 100%;
  animation: badge-spin 20s linear infinite;
}

.badge text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  fill: var(--ink);
}

.badge-ring {
  fill: none;
  stroke: color-mix(in srgb, var(--ink) 30%, transparent);
  stroke-width: 1;
}

.badge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 1.3rem;
}

/* Hero 底部跑马灯 */
.marquee {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  overflow: hidden;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

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

.marquee-group {
  display: flex;
  align-items: center;
  gap: 34px;
  padding-right: 34px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

.marquee-group .star {
  color: var(--accent);
}

/* ---------- 章节 ---------- */
.section {
  position: relative;
  padding: clamp(80px, 11vw, 150px) var(--gutter);
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: clamp(18px, 3vw, 40px);
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-no {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  will-change: transform;
}

.kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(32px, 6vw, 90px);
}

.about-vertical {
  writing-mode: vertical-rl;
  font-weight: 900;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  letter-spacing: 0.5em;
  color: var(--ink-2);
  border-left: 1px solid var(--line);
  padding-left: 22px;
  user-select: none;
}

.lead {
  max-width: 880px;
  color: var(--ink-2);
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  line-height: 1.9;
}

.lead::first-letter {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 2.1em;
  line-height: 1;
  padding-right: 0.08em;
}

/* ---------- 科研方向：大列表行 ---------- */
.research-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.research-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(28px, 4vw, 46px) clamp(8px, 1.5vw, 22px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.research-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s var(--ease-inout);
}

.research-row:hover::before {
  transform: scaleY(1);
}

.row-no {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-2);
  transition: color 0.35s;
}

.row-body {
  position: relative;
  z-index: 1;
  transition: color 0.35s;
}

.row-body h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  transition: color 0.35s, transform 0.5s var(--ease-out);
}

.row-body p {
  margin-top: 8px;
  max-width: 620px;
  color: var(--ink-2);
  transition: color 0.35s;
}

.row-arrow {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--ink-2);
  transform: translateX(-8px);
  opacity: 0.35;
  transition: transform 0.5s var(--ease-out), color 0.35s, opacity 0.35s;
}

.research-row:hover .row-no,
.research-row:hover .row-body h3,
.research-row:hover .row-arrow {
  color: #fff;
}

.research-row:hover .row-body p {
  color: rgba(255, 255, 255, 0.82);
}

.research-row:hover .row-body h3 {
  transform: translateX(10px);
}

.research-row:hover .row-arrow {
  transform: translateX(0);
  opacity: 1;
}

/* ---------- 联系（暗色区块） ---------- */
.contact-section {
  background: var(--dark);
  color: var(--dark-ink);
  --line: var(--dark-line);
  --ink-2: var(--dark-ink-2);
}

.contact-section .section-no {
  -webkit-text-stroke-color: var(--accent);
}

.contact-section .section {
  border-top: none;
}

.contact-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--dark-line);
}

.contact-link {
  position: relative;
  display: grid;
  grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(26px, 4vw, 44px) clamp(8px, 1.5vw, 22px);
  border-bottom: 1px solid var(--dark-line);
  overflow: hidden;
  transition: background 0.4s var(--ease-out);
}

.contact-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.4s var(--ease-inout);
}

.contact-link:hover::before {
  transform: scaleY(1);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--dark-ink-2);
  text-transform: uppercase;
}

.contact-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 3.2vw, 2.5rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
  transition: color 0.3s;
}

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

.contact-arrow {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  color: var(--dark-ink-2);
  transition: transform 0.45s var(--ease-out), color 0.3s;
}

.contact-link:hover .contact-arrow {
  transform: translate(6px, -6px);
  color: var(--accent);
}

/* ---------- 页脚 ---------- */
.site-footer {
  padding: clamp(40px, 6vw, 80px) var(--gutter) 30px;
  border-top: 1px solid var(--line);
}

.footer-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 12vw, 11rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--ink) 28%, transparent);
  user-select: none;
  transition: -webkit-text-stroke-color 0.5s;
}

.footer-mark:hover {
  -webkit-text-stroke-color: var(--accent);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(28px, 4vw, 48px);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-2);
}

.footer-row a {
  color: var(--ink);
}

/* ---------- 摄影页 ---------- */
.gallery-hero {
  position: relative;
  padding: 170px var(--gutter) clamp(50px, 7vw, 90px);
  overflow: hidden;
}

.gallery-hero .eyebrow {
  color: var(--dark-ink-2, var(--ink-2));
}

body.page-gallery .eyebrow {
  color: var(--ink-2);
}

.gallery-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 1;
  letter-spacing: -0.015em;
}

.gallery-hero .gallery-intro {
  max-width: 680px;
  margin-top: 26px;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 1.8vw, 1.3rem);
}

.gallery-count {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(40px, 6vw, 76px);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.masonry {
  columns: 3 300px;
  column-gap: 20px;
  padding: 10px var(--gutter) clamp(80px, 10vw, 130px);
}

.masonry figure {
  position: relative;
  break-inside: avoid;
  margin: 0 0 20px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface, var(--dark-2));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.masonry img {
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.04);
  transform: scale(1.001);
  transition: filter 0.6s var(--ease-out), transform 0.8s var(--ease-out);
}

.masonry figure:hover img {
  filter: grayscale(0) contrast(1);
  transform: scale(1.045);
}

.masonry figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 44px 18px 16px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: #fff;
  background: linear-gradient(to top, rgba(10, 10, 8, 0.72), transparent);
  transform: translateY(102%);
  transition: transform 0.5s var(--ease-out);
}

.masonry figure:hover figcaption,
.masonry figure:focus-visible figcaption {
  transform: translateY(0);
}

/* ---------- 灯箱（JS 动态创建） ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 8, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lb-figure {
  max-width: 90vw;
  margin: 0;
}

.lb-img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out);
}

.lightbox.open .lb-img.lb-ready {
  opacity: 1;
  transform: scale(1);
}

.lb-cap {
  margin-top: 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: #9b968a;
}

.lb-btn {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(242, 239, 231, 0.28);
  border-radius: 50%;
  background: transparent;
  color: #f2efe7;
  font-size: 1.25rem;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.lb-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232, 68, 46, 0.12);
}

.lb-close {
  top: 26px;
  right: 26px;
}

.lb-prev {
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-counter {
  position: absolute;
  top: 40px;
  left: 32px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  color: #9b968a;
}

/* ---------- 首屏入场动画（不依赖 JS） ---------- */
.fx {
  opacity: 0;
  animation: fx-up 1s var(--ease-out) forwards;
}

.fx-2 {
  animation-delay: 0.12s;
}

.fx-3 {
  animation-delay: 0.28s;
}

.fx-4 {
  animation-delay: 0.42s;
}

.fx-clip {
  opacity: 1;
  animation: fx-clip 1.1s var(--ease-out) 0.35s forwards;
  clip-path: inset(100% 0 0 0);
}

.fx-6 {
  animation-delay: 0.75s;
}

@keyframes fx-up {
  from {
    opacity: 0;
    transform: translateY(44px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fx-clip {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@keyframes badge-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 滚动显现（html.js 由 main.js 添加） ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(42px);
  transition: opacity 0.9s ease, transform 0.9s var(--ease-out);
}

html.js .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

html.js .reveal[data-delay="1"] {
  transition-delay: 0.1s;
}

html.js .reveal[data-delay="2"] {
  transition-delay: 0.2s;
}

html.js .reveal[data-delay="3"] {
  transition-delay: 0.3s;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 120px;
    padding-bottom: 130px;
    gap: 56px;
  }

  .hero-side {
    justify-self: start;
    width: min(66vw, 340px);
  }

  .hero-watermark {
    font-size: clamp(5rem, 20vw, 12rem);
  }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    font-size: 0.8rem;
  }

  .section-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .about-vertical {
    writing-mode: horizontal-tb;
    border-left: none;
    border-bottom: 1px solid var(--line);
    padding: 0 0 14px;
    letter-spacing: 0.4em;
  }

  .research-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .row-arrow {
    display: none;
  }

  .contact-link {
    grid-template-columns: 1fr auto;
  }

  .contact-label {
    grid-column: 1 / -1;
  }

  .gallery-count {
    position: static;
    display: block;
    margin-top: 30px;
  }
}

@media (max-width: 520px) {
  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1.3;
  }

  .hero-name-en {
    margin-left: 0.8rem;
  }

  .hero-actions .button {
    flex: 1;
  }

  .masonry {
    columns: 1;
  }

  .lb-prev {
    left: 12px;
  }

  .lb-next {
    right: 12px;
  }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fx,
  .fx-clip {
    animation: none;
    opacity: 1;
    clip-path: none;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .marquee-track {
    animation: none;
  }

  .badge {
    animation: none;
  }

  .masonry img {
    filter: none;
    transition: none;
  }

  .research-row::before,
  .contact-link::before {
    transition: none;
  }

  .site-header {
    transition: none;
  }
}
