/* ===== Trust Museum 站基础（1:1 复刻自 Figma 1.2.3 / 3. Abby Teng） ===== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@400;500;600;900&family=Heebo:wght@400;500&display=swap');

:root {
  --paper: #F7F1E5;      /* 米黄纸底 */
  --ink: #2E2418;        /* 深棕文字 */
  --ink-soft: #5C4F3D;
  --seal: #8E3B2F;       /* 暗红章戳 */
  --gold: #B08A3E;
  --serif: Georgia, 'Cormorant Garamond', 'Songti SC', 'SimSun', serif;
  --sans: 'Inter', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--paper); font-family: var(--serif); color: var(--ink); }
a { color: inherit; text-decoration: none; }
/* 2026-11-11 GPU 渗色修复（全站）：fit.js 非整数缩放下，img 边缘双线性采样会读到纹理外
   显存，形成贴着图片边框的白色/浅色细线（objects.html 撕纸条、照片带底部均已复现）。
   translateZ(0) 将图片提升为独立合成层，合成器把层边界对齐到整数设备像素，分数采样消失。
   1x（缩放=1）环境渲染不受影响；已有自身 transform 的图（如首页 .cz-img）特异性更高不受影响 */
img { display: block; transform: translateZ(0); }

.canvas { position: relative; width: 1440px; margin: 0 auto; overflow: hidden; background: var(--paper); }

/* ===== 顶部导航（Header 128 高 + Divider y126） ===== */
.tm-header { position: absolute; top: 0; left: 0; width: 1440px; height: 128px; z-index: 30; }
.tm-wordmark { position: absolute; left: 144px; top: 40px; font-family: var(--serif); font-style: italic; font-size: 28px; }
.tm-nav { position: absolute; right: 144px; top: 49px; display: flex; gap: 48px; font-family: var(--sans); }
.tm-nav a { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; color: var(--ink); }
.tm-nav a:hover, .tm-nav a.active { color: var(--seal); }
.tm-divider { position: absolute; left: 144px; top: 126px; width: 1152px; height: 1px; background: rgba(46, 36, 24, 0.3); z-index: 30; }

/* ===== 全屏导航浮层（Overlay）—— 已被上方 .tm-navdrop 悬停浮层取代 =====
   （设计真值 p3-overlay-m*.png 除面板外全透明，故实际生效结构是 .tm-navdrop；
     此块保留仅作历史兼容，现无页面引用；默认 display:none 不入图） */
.tm-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(247, 241, 229, 0.96); width: 100%;
}
.tm-overlay.open { display: block; }
.tm-overlay .inner { position: relative; width: 1440px; margin: 0 auto; height: 1080px; }
.tm-overlay .close {
  position: absolute; right: 144px; top: 40px; font-family: var(--sans);
  font-size: 12px; letter-spacing: 0.08em; cursor: pointer;
}
.tm-overlay ol { list-style: none; position: absolute; left: 144px; top: 200px; }
.tm-overlay li { margin-bottom: 44px; }
.tm-overlay li a { display: flex; align-items: baseline; gap: 28px; }
.tm-overlay li .no { font-family: var(--sans); font-size: 16px; font-weight: 500; color: var(--seal); }
.tm-overlay li .t { font-family: var(--serif); font-size: 54px; color: var(--ink); }
.tm-overlay li a:hover .t { color: var(--seal); }

/* ===== 导航下拉面板（THE TRUST MUSEUM / ACTION & WORK 悬停展开） =====
   设计真值（exports/audit 今日导出，透明底 1440x1080；旧 exports/ 版本已过时）：
     p3-overlay-museum-nav.png  面板 x600-960 y126-328（361x203），4 项，墨迹顶 y156/200/245/290（行距 ~45）
       第4项 "Patient Stories"（墨迹 x631-755，→ patient-stories.html）
     p3-overlay-work-nav.png    面板 x850-1409 y126-323（560x198），4 项，墨迹顶 y155/194/235/275（行距 40）
       （今日稿删去 "Essay on Politician's Lying"，"Reshape of Campus Life" 即第4行）
   面板底 = 纸色 #F7F1E5；条目 Inter 400 20px ls-1px / #173A35（cap 15px，逐条实测宽度对齐参考墨迹） */
.tm-navdrop {
  display: none; position: absolute; top: 126px; z-index: 40;
  background: var(--paper);
  font-family: var(--sans);
  font-weight: 400; font-size: 20px; line-height: 1; letter-spacing: -1px;
  color: #173a35;
}
.tm-navdrop::before {
  /* 隐形悬停桥：接在导航行与面板顶(y126)之间的真实空隙，鼠标下移经过时不收起。
     高度由 fit.js 按本页导航实际底边实测写入 --nav-bridge-h（设计坐标 126 − 导航底）；
     无 JS 兜底值 62px = base 布局导航底(y64)到面板顶的空隙。
     2026-11-02 修复「导航点不动」：原固定 y64-126 整宽带桥在导航行位置较低的页面
     （museum-intro/museum/整图烘焙内容页等，导航底 y101-104）会盖住导航项本身——
     悬停展开面板的同时点击落在桥上（面板空白区），导航点击全部失效（Figma 行为：点导航=直接跳转） */
  content: ''; position: absolute; left: 0;
  top: calc(-1 * var(--nav-bridge-h, 62px)); width: 100%;
  height: var(--nav-bridge-h, 62px);
}
.tm-navdrop a {
  position: absolute; left: 30px; white-space: nowrap;
  color: inherit; text-decoration: none;
}
.tm-navdrop a:hover { color: var(--seal); }
.nd-museum { left: 600px; width: 361px; height: 203px; }
.nd-work { left: 850px; width: 560px; height: 198px; }
/* 条目纵向：墨迹顶相对面板顶 29/74/119/164（museum，行距 45）与 29/69/109/149（work，行距 40） */
.nd-museum a:nth-child(1) { top: 27px; }
.nd-museum a:nth-child(2) { top: 72px; }
.nd-museum a:nth-child(3) { top: 117px; }
.nd-museum a:nth-child(4) { top: 162px; }
.nd-work a:nth-child(1) { top: 27px; }
.nd-work a:nth-child(2) { top: 67px; }
.nd-work a:nth-child(3) { top: 107px; }
.nd-work a:nth-child(4) { top: 147px; }
/* 展开规则：悬停对应导航项（:has）或已展开面板自身（含上方隐形桥） */
.canvas:has(.tm-nav a[href="museum.html"]:hover) .nd-museum,
.nd-museum:hover { display: block; }
.canvas:has(.tm-nav a[href="work.html"]:hover) .nd-work,
.nd-work:hover { display: block; }
/* 悬停浮层淡入：ON_HOVER OVERLAY DISSOLVE 0.12s ease-out（interactions.json nav_hover_overlay）。
   display:none → block 切换时播放一次；默认仍 display:none 不入截图，移开即收起。 */
@keyframes tm-drop-in { from { opacity: 0; } }
.tm-navdrop { animation: tm-drop-in 0.12s ease-out; }

/* ===== 全局动效（assets/js/motion.js，参数为 interactions.json 实测值） ===== */
/* 页面转场时长档位：默认(导航) 250ms / data-transition="smart"(内容卡/行/CTA) 300ms /
   浮层菜单项(.tm-navdrop 内) 200ms，均 ease-out；--tm-vt-dur 由 motion.js 在离场前写入 */
:root { --tm-vt-dur: 250ms; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--tm-vt-dur, 250ms);
  animation-timing-function: ease-out;
}
/* 离场态：仅由 motion.js 在点击后添加（View Transitions 快照的“新状态”），
   淡到纸色而非透明，pageshow 返回时由 motion.js 移除——任何初始渲染都不带此类 */
html.tm-leave { background: var(--paper); }
html.tm-leave body { opacity: 0; }

/* 详情页右上 ×（统一 class="tm-close"）：设计稿 × 字形约在 (1240,120)-(1256,136)，
   页面用参考图整页呈现时放一个同位隐形热区即可（空内容、无背景边框 → 不入截图）；
   motion.js 拦截点击 → 淡出 + history.back()，href 仅作无历史/无 JS 兜底。 */
.tm-close {
  position: absolute; z-index: 40; display: block;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  outline: none; background: none; border: 0; color: transparent; font-size: 0;
}

/* ===== 交互反馈动效（2026-11-03 甲方验收：按钮 hover 整体换色 / 内容卡 hover 动效） =====
   按钮视觉烘焙在参考图切片里（透明热区 <a class="hit btn-hit">）。悬停换色以热区伪元素实现：
   ::after 常驻 data-label 文字（初始全透明，静态截图/像素比对不受影响），悬停时整颗按钮
   换色（background-color + color 0.25s ease-out）：
     · 实心墨绿按钮（默认 .btn-hit）          悬停 → 章戳暗红 #8E3B2F 底 + 纸色 #F7F1E5 字
       （章戳红即全站导航 hover 色，与纸底对比清晰，不会像纸色填块一样隐没）
     · 描边空心按钮（.btn-hit.btn-hit-inverse）悬停 → 实心墨绿 #173A35 底 + 纸色 #F7F1E5 字
   形状对齐（2026-11-03 复审：按钮均为小圆角长方形 8-12px，非药丸）：--bin 内缩按烤图
   外沿外扩 1px（连抗锯齿边一起盖住，绝不露原边框线），--btn-radius 比实测圆角小 2px
   保证四角全覆盖。颜色全部取自站点色板。 */
a.btn-hit::after {
  content: attr(data-label);
  position: absolute; inset: var(--bin, 4px);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--btn-radius, 8px);
  font-family: var(--sans); font-weight: 500;
  font-size: var(--btn-fs, 17px); letter-spacing: var(--btn-ls, 0);
  white-space: nowrap;
  background: rgba(142, 59, 47, 0);
  color: rgba(247, 241, 229, 0);
  transition: background-color .25s ease-out, color .25s ease-out;
  pointer-events: none;
}
a.btn-hit:hover::after, a.btn-hit:focus-visible::after {
  background: #8E3B2F;
  color: #F7F1E5;
}
a.btn-hit.btn-hit-inverse::after {
  background: rgba(23, 58, 53, 0);
  color: rgba(247, 241, 229, 0);
}
a.btn-hit.btn-hit-inverse:hover::after,
a.btn-hit.btn-hit-inverse:focus-visible::after {
  background: #173A35;
  color: #F7F1E5;
}
/* 卡片 hover（2026-11-03 终版：无框/无阴影/无蒙层的“卡片本体缩放”）：
   视觉烘焙在切片里，无法直接 transform 卡片 → 在热区内叠一张该卡的专属小切片
   （.cz-img，原位贴合底图，scale(1) 时像素重合、不可见），悬停仅这张切片以卡中心
   放大 4%，等效于卡片本体轻微浮起；相邻卡使用各自独立切片，互不影响。
   （初版共用整页大图导致悬停时全页内容微动，已废弃。）放大溢出热区 ~7px 属预期
   （卡片边缘放大），底图被盖住的部分即为卡片“变大”的部分。DPR>1 时 fit.js 会把
   cz-img 一并切到 @2x，保持清晰。 */
.card-zoom .cz-img {
  position: absolute;
  margin: 0; padding: 0; border: 0;
  transform: scale(1);
  transform-origin: center;
  transition: transform .3s ease-out;
  pointer-events: none;
}
.card-zoom:hover .cz-img,
.card-zoom:focus-visible .cz-img { transform: scale(1.04); }

/* 卡片分区（museum.html 底部双卡热区容器，无视觉层） */
.card-zone { position: absolute; z-index: 20; pointer-events: none; }
.card-zone .hit { pointer-events: auto; }

/* ===== 视频封面播放按钮（xia-xia-qian.html Video Preview 槽位） =====
   封面中央半透明墨绿圆 + 纸色三角，悬停轻微放大；点击播放后由 JS 隐藏，
   暂停/播完自动重现（native controls 不受影响）。 */
.video-cover {
  position: absolute; z-index: 15;
  display: flex; align-items: center; justify-content: center;
  border: 0; padding: 0; margin: 0; cursor: pointer;
  background: transparent; -webkit-tap-highlight-color: transparent;
}
.video-cover .play-disc {
  width: 104px; height: 104px; border-radius: 50%;
  background: rgba(23, 58, 53, .62);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s ease-out, background .25s ease-out;
}
.video-cover .play-disc::after {
  content: ''; display: block;
  width: 0; height: 0; margin-left: 8px;
  border-style: solid; border-width: 19px 0 19px 32px;
  border-color: transparent transparent transparent #F7F1E5;
}
.video-cover:hover .play-disc { transform: scale(1.07); background: rgba(23, 58, 53, .78); }
.video-cover.hidden { display: none; }

/* ===== 真实 HTML 按钮（2026-11-03「文字直接 HTML 化」：纯色药丸上的按钮改为常驻
   HTML 文字 + 背景，不再是烤图 + hover 蒙层；hover 同样整颗换色为章戳红） ===== */
a.btn-real {
  position: absolute; z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #173A35; color: #F7F1E5; border-radius: 8px;
  font-family: var(--sans); font-weight: 500; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: background-color .25s ease-out;
}
a.btn-real:hover, a.btn-real:focus-visible { background: #8E3B2F; }
a.btn-real:focus-visible { outline: none; }
/* 描边空心变体（WATCH FILM/PLAY 等）：纸底绿描边绿字，hover 填充墨绿反白 */
a.btn-real.btn-real-outline {
  background: transparent; color: #173A35;
  border: 1.5px solid #173A35;
}
a.btn-real.btn-real-outline:hover, a.btn-real.btn-real-outline:focus-visible {
  background: #173A35; color: #F7F1E5; border-color: #173A35;
}

/* ===== 导航带 HTML 化（通用：深绿带色块 + 字标/三链接 HTML 白字；Figma 真值：
   品牌字 Georgia 34 (639,15,161x39)；导航 Helvetica Neue 18，y82（HOME x500 /
   THE TRUST MUSEUM x630 / ACTION & WORK x880），当前区加粗（.on）===== */
.nav-band { position: absolute; left: 0; top: 0; width: 1440px; height: 128px; background: #173A35; z-index: 4; }
.wordmark-real {
  position: absolute; left: 639px; top: 15px; width: 161px; height: 39px; z-index: 5;
  font-family: Georgia, 'Times New Roman', serif; font-style: normal;
  font-size: 34px; line-height: 39px; color: #F7F1E5; white-space: nowrap;
}
.nav-real { position: absolute; left: 0; top: 0; width: 1440px; height: 127px; z-index: 5; pointer-events: none; }
.nav-real span {
  position: absolute; top: 82px; height: 21px; line-height: 21px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400;
  font-size: 18px; letter-spacing: 0; color: #F7F1E5; white-space: nowrap;
}
.nav-real span.on { font-weight: 700; }

/* ===== 卡片文字 HTML 化（首页三卡：kicker + 衬线标题，卡纸底 #FFFAF0 遮罩） ===== */
.card-mask { position: absolute; z-index: 5; background: #FFFAF0; }

/* ===== 遮罩纸纹融合（2026-11-04 甲方反馈「遮罩框太正」）=====
   底图带纸张纹理，纯色遮罩会形成平滑的“补丁”方块。给全部遮罩类叠加一层
   极淡的 SVG fractalNoise 噪点（≈4% 不透明度、细颗粒），遮罩与底图的纸感融合，
   矩形边缘不再突兀。!important 用于压过各页内联 style 的 background 简写。 */
:root {
  --paper-noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncA type='linear' slope='0.05' intercept='0'/></feComponentTransfer></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}
.card-mask, .retype-mask, .nb-mask, .about-mask, .inquiry-mask,
.mani-mask, .mani-body-mask, .premiere-mask, .cinema-mask, .ct-mask, .card-zoom .card-mask {
  background-image: var(--paper-noise) !important;
}
.kicker-real {
  position: absolute; z-index: 6;
  font-family: var(--sans); font-weight: 500; font-size: 13px;
  letter-spacing: 1px; color: #173A35; white-space: nowrap;
}
.card-title-real {
  position: absolute; z-index: 6;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-weight: 400; font-size: 26px; color: #173A35; white-space: nowrap;
}

/* ===== About/正文荧光笔标记（模拟烤图手写荧光笔：只盖行的下半部） ===== */
.hl {
  background: linear-gradient(transparent 40%, #F1CD64 40%, #F1CD64 96%, transparent 96%);
  padding: 0 2px;
}

/* ===== 卡片标题（双卡 HTML 化标题文字） ===== */
.ct-title {
  position: absolute; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 31px; letter-spacing: 1px; color: #173A35; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .tm-navdrop { animation: none; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
  a.btn-hit::after, a.btn-real, .card-zoom .cz-img,
  .video-cover .play-disc { transition: none; }
}
