/* ============================================================
   汪祉呈摄影作品集 — Gursky 极简黑白风格
   Archivo Narrow · Noto Sans SC · 白底黑字 · 左侧固定导航 · 移动端适配
   ============================================================ */

:root {
  --nav-w: 380px;
  --content-w: max(640px, min(1200px, calc(100vw - var(--nav-w) - 40px)));
  --font: 'Archivo Narrow', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: #ffffff;
  color: #000000;
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; border: 0; }
button { font-family: inherit; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
input { outline: none; }
::selection { background: #000; color: #fff; }

/* ============ 左侧固定导航（桌面） ============ */
.side-nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--nav-w);
  padding: 40px 40px 40px 76px;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  z-index: 50;
  background: #fff;
}

.logo {
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.side-nav__list {
  list-style: none;
  margin: 72px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.side-nav__list a {
  display: block;
  width: 110px;
  font-size: 18px;
  font-weight: 700;
  line-height: 18px;
  text-transform: uppercase;
  letter-spacing: 2.34px;
  color: #000;
  transition: opacity 0.2s ease;
}
.side-nav__list a:hover { opacity: 0.55; }
.side-nav__list a.active { font-weight: 700; }

.side-nav__foot {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* 社交快速链接（抖音/微博/小红书，预留待绑定） */
.social-links {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.social-links img {
  display: block;
  width: 22px;
  height: 22px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.social-links a:hover img { opacity: 1; }

/* 内联搜索框（示例站风格） */
.search-form { margin: 0; }
.search-form input {
  width: 150px;
  padding: 4px 6px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  outline: none;
}
.search-form input::placeholder { color: #000; opacity: 0.45; }
.search-form input:focus { border-color: #000; }

/* 语言切换（示例站风格：当前语言带下划线） */
.lang-switcher {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.lang-switcher li { line-height: 1; }
.lang-switcher a,
.lang-switcher .text-underline {
  font-size: 16.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.145px;
  color: #000;
  text-decoration: none;
  opacity: 0.85;
}
.lang-switcher a:hover { opacity: 1; }
.lang-switcher .text-underline {
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 1;
}

/* ============ 内容区 ============ */
.content {
  padding: 24px 20px 60px;
  min-height: 100vh;
}

/* 首页（桌面随机作品） */
.home-content { display: none; }
.home-work__image {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #fff;
}
.home-work__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.home-work__image img.loaded { opacity: 1; }
.home-work__meta {
  margin-top: 25px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
}
.home-work__meta strong { font-weight: 700; }
/* 图片按高度缩放（超高/竖图）时：帧在内容区内居中 */
.home-content.frame-narrow .home-work__image {
  margin-left: auto;
  margin-right: auto;
}
/* 仅竖图（H>W）：caption 移至图片右缘外 30px、底边与图片底对齐（同案例站），且不被 min-height:100vh 推低 */
.home-content.frame-portrait {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-start;
  min-height: 0;
}
.home-content.frame-portrait .home-work__image {
  margin-left: 0;
  margin-right: 0;
}
.home-content.frame-portrait .home-work__meta {
  margin: 0 0 0 30px;
  width: auto;
  max-width: 260px;
  flex-shrink: 0;
  text-align: left;
}

/* 列表页标题 */
.page-title {
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2.34px;
  margin-bottom: 26px;
}

/* ============ 作品表格（可排序） ============ */
.table-wrap { width: 100%; overflow-x: auto; }
.work-table { width: 100%; border-collapse: collapse; }
.work-table th {
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.34px;
  padding: 0 0 14px;
  border-bottom: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.work-table th:hover { opacity: 0.55; }
.work-table .sort-arrow { font-size: 11px; opacity: 0.6; letter-spacing: 0; }
.work-table tbody td {
  font-size: 16px;
  height: 19px;
  line-height: 19px;
  padding: 0;
  vertical-align: top;
  border: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}
.work-table tbody tr { cursor: pointer; }
.work-table tbody tr:hover { background: transparent; }
.work-table td.year { width: 110px; padding-right: 20px; font-size: 14px; color: #000; }

/* ============ 详情页 ============ */
.detail__viewer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: zoom-in;
}
.detail__frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
}
.detail__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.detail__frame img.loaded { opacity: 1; }
.detail__caption {
  margin-top: 25px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  max-width: 640px;
}
.detail__caption strong { font-weight: 700; }

/* 竖图：caption 移至图片右缘外 30px、底边与图片底对齐 */
.detail__viewer.portrait {
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
}
.detail__viewer.portrait .detail__caption {
  margin: 0 0 0 30px;
  max-width: 260px;
}
/* 横图/全景图按高度缩放：frame 靠 margin auto 水平居中，caption 左缘由 JS 精确跟随 frame 左缘 */
.detail__viewer.frame-narrow:not(.portrait) .detail__frame {
  margin-left: auto;
  margin-right: auto;
}

.detail__back { display: inline-block; margin-bottom: 24px; font-size: 14px; text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.7; }
.detail__back:hover { opacity: 1; }

/* ============ 全屏缩放查看器 ============ */
.zoomer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: none;
  overflow: hidden;
  touch-action: none;
}
.zoomer.open { display: block; }
.zoomer__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
}
.zoomer__stage.dragging { cursor: grabbing; }
.zoomer__img {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  max-width: none;
  max-height: none;
}
.zoomer__close {
  position: absolute;
  top: 6px; right: 8px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  padding: 14px 16px;
  cursor: pointer;
  z-index: 20;
  opacity: 0.85;
}
.zoomer__close:hover { opacity: 1; }
.zoomer__zoom {
  position: absolute;
  bottom: 22px; left: 24px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-family: var(--font);
  letter-spacing: 0.06em;
  z-index: 20;
  pointer-events: none;
}
.zoomer__hint {
  position: absolute;
  bottom: 22px; right: 24px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  font-family: var(--font);
  letter-spacing: 0.06em;
  z-index: 20;
  pointer-events: none;
}

/* ============ 全屏大图查看器（白底，替代详情页入口） ============ */
.lightbox {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 2000;
  display: none;
  overflow: hidden;
  touch-action: none;
}
.lightbox.open { display: block; }
.lightbox__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: zoom-in;
}
.lightbox__stage.dragging { cursor: grabbing; }
.lightbox__inner {
  position: absolute;
  left: 0; top: 0;
  /* 缩放以图片中心为基准，放大时保持居中不偏移；overflow 裁剪水印仅覆盖图片区域 */
  transform-origin: center center;
  overflow: hidden;
  will-change: transform;
}
.lightbox__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  max-width: none;
  max-height: none;
}
/* 放大模式：斜向平铺水印层（inner 的子元素，随 inner 缩放/拖动保持同步） */
.lightbox__wm {
  position: absolute;
  left: 50%; top: 50%;
  width: 170%; height: 170%;
  margin-left: -85%; margin-top: -85%;
  background-image: url('images/watermark.png');
  background-repeat: repeat;
  background-position: center;
  background-size: 220px auto; /* 打开时由 JS 按图片宽度动态设置 */
  opacity: 0.3;
  transform: rotate(-45deg);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  display: none;
}
.lightbox.zoomed .lightbox__wm { display: block; }
.lightbox__close {
  position: absolute;
  top: 6px; right: 8px;
  background: none;
  border: none;
  color: #000;
  font-size: 26px;
  line-height: 1;
  padding: 14px 16px;
  cursor: pointer;
  z-index: 20;
  opacity: 0.85;
}
.lightbox__close:hover { opacity: 1; }

/* ============ 移动端子页顶栏 ============ */
.m-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 78px;
  background: rgba(255,255,255,0.93);
  padding: 0 8px 0 20px;
  z-index: 100;
}
.m-topbar h1 {
  font-size: 22.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.m-close {
  font-size: 21px;
  line-height: 1;
  opacity: 0.8;
  padding: 15px;
  margin-right: -5px;
  flex: none;
}
.m-close:hover { opacity: 1; }

/* ============ 移动端菜单（首页） ============ */
.m-menu {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px 20px 36px;
}
.m-logo {
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  display: block;
  margin-bottom: 56px;
}
.m-menu__list { list-style: none; margin: 0; padding: 0; }
.m-menu__list li { padding-bottom: 16px; }
.m-menu__list a {
  font-size: 16.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}
.m-menu__list a.active { color: #666; }
.m-menu__foot { margin-top: auto; padding-top: 48px; }
.m-search input {
  width: 100%;
  padding: 8px 5px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  border-bottom: 1px solid #000;
  border-radius: 0;
  background: transparent;
  color: #000;
}
.m-search input::placeholder { color: #000; opacity: 0.6; }
.m-menu__links {
  display: flex;
  align-items: baseline;
  gap: 22px;
  margin-top: 22px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}
.m-social { margin: 0 0 22px; }

/* ============ 教程 / 简介 ============ */
.prose { max-width: 640px; font-size: 15px; line-height: 1.8; }
.prose p { margin-bottom: 14px; }
.prose h2 { font-size: 18px; font-weight: 700; margin: 30px 0 12px; text-transform: uppercase; letter-spacing: 1.2px; }
.equip-list { list-style: none; margin: 0; padding: 0; }
.equip-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid #e8e8e8;
  font-size: 15px;
}
.equip-list li span:last-child { font-size: 14px; opacity: 0.7; }
.tutorial-list { margin-top: 10px; }
.tutorial-item {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid #e8e8e8;
}
.tutorial-item .no { font-size: 14px; opacity: 0.6; flex: none; padding-top: 3px; }
.tutorial-item h2 { font-size: 20px; font-weight: 700; margin: 0 0 6px; text-transform: none; letter-spacing: 0; }
.tutorial-item p { margin: 0; color: #444; font-size: 14px; line-height: 1.6; }

/* ============ 搜索页 ============ */
.search-box input {
  width: 100%;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 4px;
  border: none;
  border-bottom: 1px solid #000;
  border-radius: 0;
  background: transparent;
  color: #000;
}
.search-box input::placeholder { color: #000; opacity: 0.5; }
.search-hint { font-size: 14px; color: #666; margin-top: 12px; min-height: 20px; }
.search-results { margin-top: 28px; }

/* ============ 断点：桌面（≥768px） ============ */
@media (min-width: 768px) {
  .side-nav { display: flex; }
  .m-topbar { display: none; }
  .m-menu { display: none; }
  .home-content { display: block; }

  .content,
  .home-content,
  .detail__viewer {
    margin-left: var(--nav-w);
    width: var(--content-w);
    padding: 48px 30px 80px 30px;
    min-height: 100vh;
  }

  /* 首页图片上边缘与导航「首页」文字顶部对齐 */
  .home-content {
    padding-top: 139px;
  }

  .detail__back { margin-bottom: 32px; }
}

/* ============ 横屏：顶栏 fixed -> absolute ============ */
@media (orientation: landscape) {
  .m-topbar { position: absolute; }
}
