* {
  box-sizing: border-box;
}

:root {
  --bg: #050505;
  --panel: #0a0a0a;
  --ink: #f6f3ed;
  --muted: #918d84;
  --soft: #c9c3b8;
  --line: rgba(246, 243, 237, 0.16);
  --line-soft: rgba(246, 243, 237, 0.08);
  --sidebar: clamp(220px, 19vw, 292px);
  --page-pad: clamp(22px, 3vw, 46px);
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  letter-spacing: 0;
}

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

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

button {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
  font-weight: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background:
    linear-gradient(90deg, transparent calc(var(--sidebar) - 1px), var(--line) var(--sidebar), transparent calc(var(--sidebar) + 1px)),
    var(--bg);
}

.mobile-header {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  width: var(--sidebar);
  min-width: var(--sidebar);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 22px 22px;
  background: linear-gradient(90deg, #050505 0%, #050505 83%, #070707 100%);
}

.desktop-name,
.mobile-header h1 {
  font-size: clamp(1.18rem, 1.55vw, 1.68rem);
  line-height: 1.12;
}

.name-lockup {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: end;
  column-gap: clamp(34px, 3.6vw, 58px);
}

.name-lockup .name-zh {
  line-height: 1;
}

.name-lockup .name-en {
  align-self: end;
  padding-bottom: 0.08em;
  color: var(--muted);
  font-size: 0.43em;
  line-height: 1;
  white-space: nowrap;
}

.name-lockup-en {
  display: inline-block;
}

.menu {
  display: grid;
  gap: clamp(1.12rem, 2.2vh, 1.78rem);
  margin-top: clamp(64px, 11vh, 116px);
  counter-reset: nav;
}

.menu a {
  position: relative;
  width: fit-content;
  color: var(--soft);
  font-size: 0.96rem;
  line-height: 1.25;
  transition: color 0.2s ease, transform 0.2s ease;
}

.menu a::before {
  counter-increment: nav;
  content: "0" counter(nav);
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.66rem;
}

.menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 0.2s ease;
}

.menu a:hover,
.menu a.active {
  color: var(--ink);
  transform: translateX(2px);
}

.menu a:hover::after,
.menu a.active::after {
  width: 100%;
}

.sidebar-footer {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.desktop-language {
  position: fixed;
  top: 19px;
  right: 22px;
  z-index: 30;
}

.language-toggle,
.menu-button {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.78rem;
}

.language-toggle::before {
  display: none;
  content: none;
}

.language-toggle:hover {
  color: #fff;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.main-container {
  flex: 1;
  min-width: 0;
}

.view {
  min-height: 100vh;
}

.page,
.detail-wrap,
.max-page {
  min-height: 100vh;
  padding: 24px var(--page-pad) 56px;
}

.page-kicker,
.detail-head,
.page-title {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.page-title,
.detail-head {
  margin-bottom: clamp(54px, 10vh, 104px);
}

.page-title span,
.detail-head span {
  display: inline-block;
  margin-left: 0.7rem;
  color: var(--ink);
}

.home {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1.5fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: end;
  padding: 24px var(--page-pad) 30px;
}

.home-copy {
  align-self: stretch;
  display: grid;
  align-content: space-between;
  padding-top: 0.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.home-copy h1 {
  margin-top: clamp(56px, 9vh, 112px);
  margin-left: clamp(12px, 1.8vw, 28px);
  color: var(--ink);
  font-size: clamp(2.3rem, 6.15vw, 6.85rem);
  line-height: 0.92;
}

.nowrap {
  white-space: nowrap;
}

.home-name-en {
  margin-left: clamp(12px, 1.8vw, 28px);
  margin-top: clamp(0.75rem, 1.2vw, 1.2rem);
  color: var(--muted);
  font-size: clamp(1rem, 1.28vw, 1.38rem);
  line-height: 1.1;
}

.home-meta {
  display: grid;
  gap: 0.55rem;
  max-width: 28rem;
  color: var(--soft);
  font-size: clamp(1rem, 1.2vw, 1.38rem);
  line-height: 1.42;
}

.home-frame {
  align-self: stretch;
  min-height: calc(100vh - 54px);
  display: grid;
  place-items: center;
  padding-left: clamp(8px, 1.6vw, 28px);
}

.home-frame img {
  width: 100%;
  height: calc(100vh - 70px);
  object-fit: contain;
}

.max-page {
  max-width: 1080px;
  margin: 0 auto;
}

.bio-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(220px, 0.74fr);
  gap: clamp(34px, 6vw, 86px);
  align-items: start;
}

.bio-photo {
  grid-column: 2;
  grid-row: 1;
  width: min(100%, 360px);
  margin: 0;
  object-fit: cover;
}

.bio-section {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  gap: clamp(40px, 7vh, 74px);
}

.bio-section .page-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.35rem, 5vw, 5.4rem);
  line-height: 0.98;
}

.bio-role {
  color: var(--ink);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
}

.bio-section ul {
  display: grid;
  gap: 1.15rem;
  padding: 0;
  margin: 0;
  color: var(--soft);
  font-size: clamp(0.98rem, 1.35vw, 1.18rem);
  line-height: 1.5;
  list-style: none;
}

.artwork-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(34px, 4.6vw, 72px) clamp(28px, 4vw, 64px);
  max-width: min(78vw, 980px);
  margin: 0 auto;
}

.artwork-card {
  position: relative;
  display: grid;
  gap: 1rem;
}

.artwork-card:hover .row-title {
  color: #fff;
}

.row-number,
.row-count,
.row-en {
  color: var(--muted);
  font-size: 0.82rem;
}

.row-title {
  color: var(--ink);
  font-size: clamp(1.2rem, 1.55vw, 1.68rem);
  line-height: 1.18;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.row-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #111;
}

.row-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(12%);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.artwork-card:hover .row-preview img {
  transform: scale(1.035);
  filter: grayscale(0%);
}

.artwork-card .row-number {
  position: absolute;
  top: 0.7rem;
  left: 0.75rem;
  z-index: 1;
  color: var(--ink);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65);
}

.tile-caption {
  display: grid;
  gap: 0.35rem;
  text-align: center;
}

.detail-wrap {
  width: 100%;
}

.detail-head a {
  color: var(--muted);
}

.group-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: clamp(28px, 5vh, 54px);
  color: var(--muted);
}

.group-meta h2,
.detail-meta h2 {
  color: var(--ink);
  font-size: clamp(1.5rem, 3.2vw, 3.5rem);
  line-height: 0.98;
}

.thumb-strip {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(6px, 0.9vw, 12px);
}

.thumb-strip a {
  grid-column: span 3;
  min-height: 160px;
  overflow: hidden;
  background: #111;
}

.thumb-strip a:nth-child(7n + 1) {
  grid-column: span 6;
  grid-row: span 2;
}

.thumb-strip a:nth-child(5n + 3) {
  grid-column: span 4;
}

.strip-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: opacity 0.2s ease, transform 0.35s ease;
}

.thumb-strip a:hover .strip-image {
  opacity: 0.88;
  transform: scale(1.025);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.36fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.detail-meta {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.carousel {
  display: grid;
  gap: 1rem;
}

.carousel-frame {
  margin: 0;
  display: grid;
  place-items: center;
  background: #090909;
  min-height: min(68vh, 760px);
  border: 1px solid var(--line-soft);
}

.carousel-frame img {
  display: block;
  max-width: 100%;
  max-height: min(68vh, 760px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.carousel-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.carousel-controls button {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.carousel-controls button:last-child {
  justify-self: end;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.2vw, 32px);
}

.video-card {
  display: grid;
  gap: 1rem;
}

.video-card video,
.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line-soft);
  background: #111;
}

.video-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.video-card h2 {
  color: var(--soft);
  font-size: 1rem;
  text-align: center;
}

.contact-list {
  display: grid;
  gap: clamp(26px, 4vh, 44px);
  max-width: 620px;
  padding: 0;
  margin: clamp(38px, 8vh, 90px) 0 0;
  list-style: none;
}

.contact-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: clamp(18px, 4vw, 64px);
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.contact-list strong {
  color: var(--muted);
  font-weight: inherit;
}

.pull-refresh {
  position: fixed;
  top: -42px;
  left: 50%;
  z-index: 80;
  padding: 0.54rem 0.76rem;
  border: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.92);
  color: var(--soft);
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.pull-refresh.visible {
  opacity: 1;
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    background: var(--bg);
  }

  .desktop-language {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 5, 5, 0.94);
    backdrop-filter: blur(10px);
  }

  .mobile-header h1 {
    min-width: 0;
    max-width: 48%;
    overflow: hidden;
    font-size: 1.15rem;
  }

  .mobile-header .name-lockup {
    column-gap: 9px;
  }

  .mobile-header .name-en {
    display: none;
  }

  .mobile-actions {
    display: contents;
  }

  .mobile-header .language-toggle,
  .mobile-header .menu-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .mobile-header .language-toggle {
    left: min(calc(100vw - 122px), 300px);
    right: auto;
    gap: 0.36rem;
    font-size: 0;
    white-space: nowrap;
  }

  .mobile-header .language-toggle::after {
    content: "\4e2d";
    font-size: 0.72rem;
  }

  .mobile-header .language-toggle::before {
    width: 18px;
    height: 18px;
  }

  .menu-button {
    left: min(calc(100vw - 50px), 350px);
    right: auto;
    font-size: 0.86rem;
  }

  .sidebar {
    position: fixed;
    top: 62px;
    left: 0;
    width: 100%;
    min-width: 0;
    height: calc(100vh - 62px);
    padding: 26px 18px 22px;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    border-right: 0;
    background: rgba(5, 5, 5, 0.98);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .desktop-name {
    display: none;
  }

  .menu {
    gap: clamp(1.35rem, 4vh, 2.1rem);
    margin-top: 1rem;
  }

  .menu a {
    width: 100%;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: clamp(1.25rem, 5.4vw, 1.8rem);
  }

  .menu a::before {
    margin-bottom: 0.36rem;
    font-size: 0.72rem;
  }

  .menu a::after {
    display: none;
  }

  .home {
    min-height: calc(100vh - 62px);
    grid-template-columns: 1fr;
    align-items: start;
    padding: 18px 16px 24px;
  }

  .home-copy {
    align-content: start;
    gap: clamp(76px, 12vh, 112px);
  }

  .home-copy h1 {
    margin-top: 0.35rem;
    margin-left: 0;
  }

  .home-name-en {
    margin-left: 0;
    margin-top: 0.55rem;
    font-size: 0.95rem;
  }

  .home-frame {
    min-height: auto;
    padding-left: 0;
    border-left: 0;
  }

  .home-frame img {
    height: auto;
    max-height: 58vh;
  }

  .page,
  .detail-wrap,
  .max-page {
    min-height: calc(100vh - 62px);
    padding: 18px 16px 42px;
  }

  .bio-layout,
  .detail-layout,
  .contact-list li {
    grid-template-columns: 1fr;
  }

  .bio-photo,
  .bio-section {
    grid-column: 1;
  }

  .bio-section {
    grid-row: 1;
  }

  .bio-photo {
    grid-row: 2;
  }

  .bio-photo {
    width: min(100%, 320px);
  }

  .artwork-index {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 2.4rem;
  }

  .artwork-card {
    gap: 0.85rem;
  }

  .row-title {
    white-space: nowrap;
    font-size: clamp(1.28rem, 5.2vw, 1.72rem);
  }

  .row-en {
    line-height: 1.45;
  }

  .row-preview {
    justify-self: stretch;
    width: 100%;
  }

  .thumb-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .thumb-strip a,
  .thumb-strip a:nth-child(5n + 3) {
    grid-column: span 3;
  }

  .thumb-strip a:nth-child(7n + 1) {
    grid-column: span 6;
  }

  .detail-meta {
    position: static;
  }

  .carousel-frame {
    min-height: auto;
  }

  .carousel-frame img {
    width: 100%;
    max-height: none;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }
}
