/* ===== 王君 设计作品集 — Foster-inspired redesign ===== */

:root {
  --ink:       #111;
  --ink-2:     #1f1f1f;
  --sub:       #5a5a5a;
  --sub-2:     #8a8a8a;
  --line:      #ececec;
  --line-2:    #f3f3f3;
  --bg:        #ffffff;
  --bg-soft:   #fafafa;
  --bg-hover:  #f5f5f5;
  --accent:    #1f1f1f;          /* 极简以黑为主，少量暖色仅作点缀 */
  --accent-soft: #9a6a3c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --sans:      "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --serif:     "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: var(--sans);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 18px 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--serif);
  font-size: 18px; font-weight: 600;
  letter-spacing: 0.02em;
}
.brand-en {
  margin-left: 10px;
  font-family: var(--sans);
  font-size: 12px; font-weight: 400;
  color: var(--sub-2); letter-spacing: 0.14em;
  text-transform: uppercase;
}
/* ---- Header controls（搜索+筛选并入右上角） ---- */
.brand-wrap {
  position: relative;
  display: flex; align-items: baseline; gap: 10px;
  cursor: pointer;
  user-select: none;
}
.header-controls {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; justify-content: flex-end;
}
.search {
  width: 190px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
}
.search::placeholder { color: var(--sub-2); }
.search:focus { border-color: var(--ink); background: var(--bg); }

/* ---- 个人名片（点击打开 · 移开自动关闭） ---- */
.profile-card {
  position: absolute; top: calc(100% + 14px); left: 0;
  min-width: 280px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
  padding: 18px 20px;
  z-index: 60;
}
.profile-card::before {
  content: ""; position: absolute; top: -6px; left: 26px;
  width: 10px; height: 10px;
  background: var(--bg);
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.profile-head { padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.profile-name { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); display: block; }
.profile-role { font-size: 12px; color: var(--sub); margin-top: 2px; letter-spacing: .03em; }
.profile-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
  font-size: 13px;
}
.profile-label {
  flex: none; width: 34px;
  font-size: 11px; color: var(--sub-2);
  letter-spacing: .1em;
}
.profile-val { flex: 1; color: var(--ink); word-break: break-all; }
.copy-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  color: var(--sub);
  transition: background .15s, color .15s, border-color .15s;
}
.copy-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.copy-btn.copied { background: var(--accent-soft); color: #fff; border-color: var(--accent-soft); font-size: 12px; }

.select {
  position: relative;
}
.select select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 8px 28px 8px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink);
  cursor: pointer;
  outline: none;
  min-width: 116px;
  transition: border-color .15s;
}
.select select:focus, .select select:hover { border-color: var(--ink); }
.select::after {
  content: "▾";
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--sub-2); font-size: 10px;
}

.reset-link {
  background: transparent; border: none;
  font-size: 13px; color: var(--sub);
  cursor: pointer; padding: 6px 10px;
  transition: color .15s;
  font-family: var(--sans);
}
.reset-link:hover { color: var(--ink); }

/* ---- Main / grid ---- */
.main {
  padding: 32px 56px 80px;
  background: var(--bg);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 32px;
}
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---- Card (image + caption, no border) ---- */
.card {
  cursor: pointer;
  background: transparent;
}
.card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;          /* 关键：16:9 */
  background: var(--bg-soft);
  overflow: hidden;
}
.card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;             /* 浏览器中心裁切 */
  transition: transform .5s ease, opacity .25s;
  display: block;
}
.card:hover .card-cover img { transform: scale(1.025); }

/* ---- 双图封面（方案图随鼠标 X 位置从左展开） ---- */
.card.has-dual .card-cover { position: relative; }
.card.has-dual .card-cover > img,
.card.has-dual .cover-compare,
.card.has-dual .cover-compare img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.card.has-dual .card-cover > img,
.card.has-dual .cover-compare img { transition: none; }
.card.has-dual:hover .card-cover img { transform: none; }
.cover-compare { z-index: 2; }
.cv-design {
  clip-path: inset(0 calc(100% - var(--pos, 0%)) 0 0);
  transition: clip-path .05s linear;
}
.cover-line {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 0%);
  width: 1px; background: rgba(255,255,255,.9);
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.card.has-dual:hover .cover-line { opacity: 1; }

/* 双封面对比手柄：分割线中点可拖动圆钮，拖动调实景/方案分界线 */
.cover-handle {
  position: absolute; top: 50%; left: var(--pos, 50%);
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(20,20,20,.55); border: 2px solid rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: ew-resize; z-index: 3;
  opacity: 0; transition: opacity .15s; touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.card.has-dual:hover .cover-handle { opacity: 1; }
/* 触摸设备常显手柄，提示可拖动对比 */
@media (hover: none) { .card.has-dual .cover-handle { opacity: 1; } }
.cover-handle svg { width: 22px; height: 22px; display: block; }

.card-caption {
  padding-top: 14px;
}
.card-title {
  font-family: var(--serif);
  font-size: 17px; font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.35;
}
.card-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px;
  color: var(--sub);
  letter-spacing: 0.02em;
}
.card-id { color: var(--sub-2); margin-right: 6px; }
.card-arrow {
  display: inline-block;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .25s, transform .25s;
  color: var(--ink);
}
.card:hover .card-arrow { opacity: 1; transform: translateX(0); }

/* ---- Empty state ---- */
.empty {
  padding: 80px 0; text-align: center;
  color: var(--sub); font-size: 14px;
}

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6);
  overflow-y: auto;
  display: none;
}
.modal.open { display: block; }
.modal-body {
  position: relative;
  background: var(--bg);
  max-width: 1200px;
  margin: 40px auto;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: slide-up .3s ease;
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.9);
  border: none; border-radius: 50%;
  font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  transition: background .15s;
}
.modal-close:hover { background: var(--ink); color: #fff; }

.modal-cover {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg-soft); overflow: hidden;
}
.modal-cover img { width: 100%; height: 100%; object-fit: cover; }

.modal-content {
  padding: 40px 64px 80px;
  max-width: 980px; margin: 0 auto;
}
.modal-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 8px;
}
.modal-id {
  font-family: var(--serif);
  font-size: 14px; color: var(--accent-soft);
  letter-spacing: 0.2em;
}
.modal-title {
  font-family: var(--serif);
  font-size: 30px; font-weight: 600;
  margin: 0;
  color: var(--ink);
  line-height: 1.25;
}
.modal-sub {
  font-size: 13px; color: var(--sub);
  letter-spacing: 0.04em;
  margin: 6px 0 24px;
}
.modal-summary {
  font-size: 16px; line-height: 1.85;
  color: var(--ink-2); opacity: .9;
  margin: 0 0 32px;
}
.modal-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.meta-key {
  font-size: 11px; color: var(--sub-2);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 6px;
}
.meta-val { font-size: 14px; color: var(--ink); }

.modal-tag-section { margin-bottom: 24px; }
.modal-tag-title {
  font-size: 11px; color: var(--sub-2);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 10px;
}
.modal-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.modal-tag {
  font-size: 12px; padding: 4px 10px;
  background: var(--bg-soft); color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 3px;
}

.gallery-title {
  font-size: 11px; color: var(--sub-2);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin: 24px 0 14px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 768px) { .gallery { grid-template-columns: 1fr; } }
.gallery-item {
  aspect-ratio: 16/9;
  background: var(--bg-soft);
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
  display: block;
}
.gallery-item:hover img { transform: scale(1.02); }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
}
.lightbox img {
  max-width: 92%; max-height: 92vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: rgba(255,255,255,0.15);
  color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 20px; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* ---- Footer ---- */
.site-footer {
  padding: 32px 56px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--sub-2);
  display: flex; justify-content: space-between;
  background: var(--bg);
}
.site-footer .beian {
  color: var(--sub-2);
  transition: color .15s;
  white-space: nowrap;
}
.site-footer .beian:hover { color: var(--ink); }

/* ---- Overview（三个大数字 · 跳动 + 悬浮放大） ---- */
.overview {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 120px;
  padding: 64px 56px 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.ov-num {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  cursor: default; user-select: none;
  transition: transform .25s ease;
  min-width: 200px;
}
.ov-num:hover { transform: scale(1.06); }
.ov-n {
  font-family: var(--serif);
  font-size: 140px; font-weight: 600; line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ov-en {
  margin-top: 20px;
  font-size: 18px; font-weight: 500;
  color: var(--sub-2);
  letter-spacing: 0.32em; text-transform: uppercase;
}

/* ---- Card role (removed) ---- */

/* ---- Timeline (全过程服务·年份轴) ---- */
.timeline {
  padding: 28px 0 4px;
  border-top: 1px solid var(--line);
  margin-bottom: 28px;
}
.tl-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 24px;
}
.tl-title {
  font-size: 11px; color: var(--sub-2);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.tl-depth {
  font-size: 11px; color: var(--sub-2); letter-spacing: 0.04em;
}
.tl-depth b { font-weight: 600; color: var(--ink); }
.tl-track {
  display: flex; justify-content: space-between;
  position: relative;
}
.tl-track::before {
  content: ""; position: absolute;
  left: 4px; right: 4px; top: 4px;
  height: 1px; background: var(--line);
}
.tl-node {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; flex: 1;
  cursor: help;
}
.tl-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.tl-node.on .tl-dot { background: var(--ink); border-color: var(--ink); }
.tl-node:hover .tl-dot {
  transform: scale(1.45);
  box-shadow: 0 0 0 4px var(--bg-soft);
}
.tl-node.on:hover .tl-dot { box-shadow: 0 0 0 4px var(--line-2); }
.tl-name {
  font-size: 11px; color: var(--sub-2);
  letter-spacing: 0.04em;
  transition: color .18s;
}
.tl-node.on .tl-name { color: var(--ink); }
.tl-node:hover .tl-name { color: var(--ink); }
.tl-year {
  font-size: 10px; color: var(--sub-2);
  letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
}
.tl-node.on .tl-year { color: var(--ink); }
.tl-depth-bar {
  margin-top: 20px;
  height: 2px; background: var(--line);
  position: relative;
}
.tl-depth-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  width: 0; background: var(--ink);
  transition: width 1s cubic-bezier(.22, 1, .36, 1);
}
.tl-foot {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 10px; color: var(--sub-2);
  letter-spacing: 0.08em; font-variant-numeric: tabular-nums;
}
.tl-foot .tl-start, .tl-foot .tl-end { color: var(--sub); }

/* ---- Responsive tweaks ---- */
@media (max-width: 768px) {
  /* 头部：筛选器占满并换行，触摸目标放大 */
  .site-header { padding: 14px 20px; flex-wrap: wrap; gap: 10px; }
  .header-controls { width: 100%; justify-content: flex-start; gap: 8px; }
  .search { width: 100%; max-width: none; padding: 11px 12px; font-size: 14px; }
  .select { flex: 1 1 30%; }
  .select select { width: 100%; padding: 11px 28px 11px 12px; font-size: 14px; }
  .reset-link { width: 100%; text-align: left; padding: 8px 2px; }

  /* 概览区：竖向堆叠居中，数字放大更易读 */
  .overview {
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 32px 20px;
  }
  .ov-num { min-width: 0; flex: none; }
  .ov-n { font-size: 60px; }
  .ov-en { font-size: 13px; margin-top: 12px; letter-spacing: 0.24em; }

  /* 内容区与卡片 */
  .main { padding: 24px 20px 60px; }
  .card-caption { padding-top: 12px; }
  .card-title { font-size: 16px; }

  /* 双封面：手机默认半分对比，并常显分割线（手指滑动可调整分割位置） */
  .card.has-dual .card-cover { --pos: 50%; }
  .card.has-dual .cover-line { opacity: 1; }

  /* 弹窗全屏 + 元信息单列 */
  .modal-body { margin: 0; border-radius: 0; }
  .modal-content { padding: 28px 20px 50px; }
  .modal-title { font-size: 22px; }
  .modal-summary { font-size: 15px; line-height: 1.8; }
  .modal-meta { grid-template-columns: 1fr; gap: 14px; padding: 20px 0; }

  .site-footer { padding: 24px 20px; flex-direction: column; gap: 6px; }
}

/* 触摸设备（手机/平板）：双封面默认显示半分对比、常显分割线，
   避免方案图因 --pos 默认 0% 被完全裁掉而在手机上不可见 */
@media (hover: none) and (pointer: coarse) {
  .card.has-dual .card-cover { --pos: 50%; }
  .card.has-dual .cover-line { opacity: 1; }
}

/* 超窄屏进一步收紧 */
@media (max-width: 480px) {
  .ov-n { font-size: 52px; }
  .ov-en { letter-spacing: 0.18em; }
  .modal-summary { font-size: 14px; }
  .gallery { gap: 12px; }
}