/* ==========================================================================
   SOK MEY · Portfolio Archive v2 — 作品集扩展样式
   依赖 site.css 中的设计变量（--ink / --violet / --rose / --lime …）
   仅新增组件，不改动原有类，保证 evidence / resume / admin 页不受影响。
   ========================================================================== */

/* ---------- 通用 ---------- */
.stack { display: grid; gap: 18px; }
.mono-label { font: 500 10px "DM Mono", monospace; letter-spacing: .13em; color: var(--violet); margin: 0; }
.muted-note { color: var(--muted); font-size: 13px; line-height: 1.75; margin: 0; }
.count-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 10px "DM Mono", monospace; letter-spacing: .1em;
  color: var(--violet); background: rgba(93, 67, 184, .07);
  border: 1px solid rgba(93, 67, 184, .16); border-radius: 999px; padding: 5px 10px;
}

/* ---------- 首页统计条 ---------- */
.metrics.is-six { grid-template-columns: repeat(6, 1fr); }
.metrics.is-six .metric strong { font-size: 34px; }

/* ---------- 板块索引（首页） ---------- */
.collection-index { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.collection-tile {
  position: relative; display: block; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--line); background: var(--paper);
  box-shadow: 0 10px 30px rgba(30, 31, 55, .05); transition: transform .25s ease, box-shadow .25s ease;
}
.collection-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.collection-tile img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #ecebe5; }
.collection-tile .tile-copy { padding: 15px 16px 17px; }
.collection-tile .tile-copy h3 { margin: 8px 0 6px; font: 700 17px/1.25 "Playfair Display", serif; letter-spacing: -.02em; }
.collection-tile .tile-copy p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.collection-tile .tile-num {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(255, 254, 253, .93); border-radius: 999px;
  font: 500 10px "DM Mono", monospace; color: var(--violet); padding: 4px 9px;
}

/* ---------- 精选条带（首页） ---------- */
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.feature-card {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper);
  display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #ecebe5; }
.feature-card .feature-body { padding: 16px 17px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.feature-card h3 { margin: 0; font: 700 17px/1.3 "Playfair Display", serif; letter-spacing: -.02em; }
.feature-card p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); flex: 1; }
.feature-card .feature-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 500 10px "DM Mono", monospace; color: var(--muted); }

/* ---------- 画廊页：板块导航 ---------- */
.gallery-hero { padding: 62px 0 34px; border-bottom: 1px solid var(--line); }
.gallery-hero h1 { font: 700 clamp(42px, 6vw, 74px)/.94 "Playfair Display", serif; letter-spacing: -.06em; margin: 0 0 16px; }
.gallery-hero h1 em { font-style: italic; color: var(--rose); }
.gallery-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 26px; }
.gallery-stats div { display: flex; flex-direction: column; gap: 4px; }
.gallery-stats strong { font: 700 26px/1 "Playfair Display", serif; letter-spacing: -.03em; }
.gallery-stats span { font: 500 10px "DM Mono", monospace; letter-spacing: .11em; color: var(--muted); }

.collection-chips {
  position: sticky; top: 0; z-index: 40; display: flex; gap: 8px; overflow-x: auto;
  padding: 14px 0; margin-bottom: 8px; background: var(--canvas);
  border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.collection-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--paper); color: #5d6577;
  border-radius: 999px; padding: 8px 13px; font: 600 11.5px "DM Sans", sans-serif;
  cursor: pointer; transition: all .2s ease; white-space: nowrap;
}
.chip:hover { border-color: var(--lav); color: var(--violet); }
.chip.active { background: var(--dark); border-color: var(--dark); color: #fff; }
.chip small { font: 500 9.5px "DM Mono", monospace; opacity: .65; margin-left: 5px; }

/* ---------- 画廊页：板块 ---------- */
.collection { padding: 54px 0 8px; scroll-margin-top: 70px; }
.collection + .collection { border-top: 1px solid var(--line); }
.collection-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 30px; }
.collection-head h2 { font: 700 clamp(30px, 3.6vw, 46px)/1.02 "Playfair Display", serif; letter-spacing: -.045em; margin: 12px 0 0; }
.collection-head .collection-intro { font-size: 14.5px; line-height: 1.8; color: var(--muted); margin: 0; }
.collection.is-hidden { display: none; }

/* ---------- 条目 ---------- */
.entry-list { display: grid; gap: 34px; }
.entry {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px;
  padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper);
}
.entry.is-wide { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
.entry-media { min-width: 0; }
.entry-body { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.entry-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry-top time { font: 500 10.5px "DM Mono", monospace; letter-spacing: .09em; color: var(--muted); }
.entry h3 { margin: 0; font: 700 21px/1.28 "Playfair Display", serif; letter-spacing: -.025em; }
.entry .entry-meta { font: 500 11px "DM Mono", monospace; letter-spacing: .05em; color: var(--violet); margin: 0; }
.entry .entry-summary { margin: 0; font-size: 13.5px; line-height: 1.78; color: #565e70; }

/* ---------- 图片组 ---------- */
.entry-images { display: grid; gap: 8px; }
.entry-images[data-count="1"] { grid-template-columns: 1fr; }
.entry-images[data-count="2"] { grid-template-columns: 1fr 1fr; }
.entry-images[data-count="3"],
.entry-images[data-count="4"] { grid-template-columns: 1fr 1fr; }
.entry-images[data-count="5"],
.entry-images[data-count="6"],
.entry-images[data-count="7"],
.entry-images[data-count="8"],
.entry-images[data-count="9"] { grid-template-columns: repeat(3, 1fr); }
.entry-images figure { margin: 0; position: relative; overflow: hidden; border-radius: 10px; background: #ecebe5; }
.entry-images img {
  width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in;
  transition: transform .35s ease;
}
.entry-images figure:hover img { transform: scale(1.04); }
.entry-images[data-count="1"] figure { aspect-ratio: 16 / 10; }
.entry-images[data-count="2"] figure { aspect-ratio: 4 / 3; }
.entry-images[data-count="3"] figure:first-child,
.entry-images[data-count="4"] figure:first-child { aspect-ratio: 4 / 3; }
.entry-images[data-count="3"] figure:not(:first-child),
.entry-images[data-count="4"] figure:not(:first-child) { aspect-ratio: 4 / 3; }
.entry-images[data-count="5"] figure,
.entry-images[data-count="6"] figure,
.entry-images[data-count="7"] figure,
.entry-images[data-count="8"] figure,
.entry-images[data-count="9"] figure { aspect-ratio: 1 / 1; }
.entry-images figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 10px 8px;
  font: 500 10px "DM Mono", monospace; color: #fff; letter-spacing: .05em;
  background: linear-gradient(transparent, rgba(20, 22, 38, .72)); pointer-events: none;
}
.entry-images .more-count {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 22, 38, .55); color: #fff; font: 700 20px "Playfair Display", serif;
  pointer-events: none;
}

/* ---------- 视频 ---------- */
.video-frame { border-radius: 12px; overflow: hidden; background: #14162a; aspect-ratio: 16 / 10; position: relative; }
.video-frame video, .video-frame img { width: 100%; height: 100%; display: block; object-fit: contain; background: #14162a; }
.video-badge {
  position: absolute; left: 10px; bottom: 10px;
  font: 600 10px "DM Mono", monospace; letter-spacing: .1em;
  color: #fff; background: rgba(20, 22, 42, .78);
  padding: 4px 8px; border-radius: 5px;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 32px;
  background: rgba(18, 19, 33, .93); backdrop-filter: blur(3px);
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(1500px, 94vw); max-height: 88vh; object-fit: contain; border-radius: 8px; display: block; }
.lightbox-close {
  position: absolute; top: 22px; right: 26px; border: 0; cursor: pointer;
  width: 42px; height: 42px; border-radius: 50%; font-size: 20px; line-height: 1;
  background: rgba(255, 255, 255, .12); color: #fff;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .24); }
.lightbox-caption {
  position: absolute; left: 0; right: 0; bottom: 24px; text-align: center;
  color: rgba(255, 255, 255, .82); font: 500 11.5px "DM Mono", monospace; letter-spacing: .06em;
  padding: 0 24px;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); border: 0; cursor: pointer;
  width: 46px; height: 46px; border-radius: 50%; font-size: 20px;
  background: rgba(255, 255, 255, .12); color: #fff;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .26); }
.lightbox-nav.prev { left: 22px; }
.lightbox-nav.next { right: 22px; }
body.lightbox-open { overflow: hidden; }

/* ---------- 时间线（经历） ---------- */
.timeline-item .evidence-row { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.timeline-item .evidence-row img {
  width: 78px; height: 58px; object-fit: cover; border-radius: 7px;
  border: 1px solid var(--line); cursor: zoom-in;
}

/* ---------- 档案统计（证据页） ---------- */
.archive-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 26px 0 34px; }
.archive-stat {
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
  padding: 16px 17px; display: flex; flex-direction: column; gap: 5px;
}
.archive-stat strong { font: 700 28px/1 "Playfair Display", serif; letter-spacing: -.03em; }
.archive-stat span { font: 500 10px "DM Mono", monospace; letter-spacing: .1em; color: var(--muted); }

/* ---------- 简历页证据缩略 ---------- */
.resume-evidence { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.resume-evidence img { width: 62px; height: 46px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }

/* ---------- 页脚补充 ---------- */
.footer .footer-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- 响应式 ---------- */
@media screen and (max-width: 1080px) {
  .metrics.is-six { grid-template-columns: repeat(3, 1fr); }
  .collection-index { grid-template-columns: repeat(2, 1fr); }
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
  .entry.is-wide { grid-template-columns: 1fr; }
  .archive-stats { grid-template-columns: repeat(2, 1fr); }
}
@media screen and (max-width: 720px) {
  .metrics.is-six { grid-template-columns: repeat(2, 1fr); }
  .metrics.is-six .metric strong { font-size: 27px; }
  .collection-index, .feature-strip { grid-template-columns: 1fr; }
  .collection-head { grid-template-columns: 1fr; gap: 16px; align-items: start; }
  .entry { padding: 17px; }
  .entry h3 { font-size: 18.5px; }
  .entry-images[data-count="5"] figure,
  .entry-images[data-count="6"] figure,
  .entry-images[data-count="7"] figure,
  .entry-images[data-count="8"] figure,
  .entry-images[data-count="9"] figure { aspect-ratio: 4 / 3; }
  .entry-images[data-count="5"],
  .entry-images[data-count="6"],
  .entry-images[data-count="7"],
  .entry-images[data-count="8"],
  .entry-images[data-count="9"] { grid-template-columns: 1fr 1fr; }
  .lightbox { padding: 14px; }
  .lightbox-nav { width: 38px; height: 38px; font-size: 17px; }
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
  .archive-stats { grid-template-columns: 1fr 1fr; }
}

/* ---------- 打印封面（仅 PDF 导出时可见） ---------- */
.print-cover { display: none; }
.print-cover h1 {
  font: 700 62pt/0.92 "Playfair Display", serif; letter-spacing: -.05em;
  margin: 6mm 0 4mm; color: #1a2030;
}
.print-eyebrow { font: 500 9pt "DM Mono", monospace; letter-spacing: .22em; color: #5d43b8; margin: 0; }
.print-sub { font: 400 13pt/1.5 "DM Sans", sans-serif; color: #687287; margin: 0 0 10mm; max-width: 120mm; }
.print-rule { height: 3px; background: #5d43b8; width: 42mm; margin-bottom: 10mm; }
.print-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12mm; margin-bottom: 14mm; }
.print-meta b {
  display: block; font: 500 8pt "DM Mono", monospace; letter-spacing: .16em;
  color: #5d43b8; text-transform: uppercase; margin-bottom: 3mm;
}
.print-meta span { display: block; font: 400 9.5pt/1.75 "DM Sans", sans-serif; color: #3d4454; }
.print-note { font: 400 9pt/1.7 "DM Sans", sans-serif; color: #687287; border-top: 1px solid #dedbd2; padding-top: 5mm; margin: 0; }

/* ---------- 打印（PDF 作品集导出） ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; }
  .site-nav, .collection-chips, .gallery-hero .gallery-stats, .lightbox,
  .button-row, .reveal-more, .admin-wrap, .locale-control, .menu-button { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .collection { page-break-before: always; padding: 0 0 6mm; }
  .collection:first-of-type { page-break-before: avoid; }
  .entry { break-inside: avoid; page-break-inside: avoid; border-color: #d8d5cc; box-shadow: none; }
  .entry-images img { cursor: default; }
  .gallery-hero { padding: 0 0 6mm; }
  .gallery-hero h1 { font-size: 40pt; }
  .print-cover { display: block; page-break-after: always; }
  .entry { padding: 4mm; }
  .entry h3 { font-size: 12pt; }
  .entry .entry-summary { font-size: 8.5pt; }
  .collection-head h2 { font-size: 20pt; }
  .collection-head .collection-intro { font-size: 9pt; }
  .video-frame video { display: none; }
  /* 打印时视频已换成封面图：高度自适应，避免固定比例留白 */
  .video-frame { aspect-ratio: auto; background: #fff; }
  .video-frame img { width: 100%; height: auto; max-height: 78mm; object-fit: contain; background: #fff; }
  .video-badge {
    position: static; display: block; margin: 1.5mm 0 0; padding: 0;
    color: #687287; background: none;
    font: 600 7pt "DM Mono", monospace; letter-spacing: .14em;
  }
  /* 打印：保持左右双栏并提高版面密度，避免每页只放一条 */
  .entry.is-wide { grid-template-columns: 1.05fr 1fr; gap: 4mm; }
  .entry { padding: 3.5mm; gap: 4mm; }
  .entry-list { gap: 4mm; }
  .collection { padding: 0 0 4mm; }
  .collection-head { margin-bottom: 5mm; gap: 8mm; }
  /* A4 内容宽约 703px，若断点未加 screen 限定会误命中移动端单栏规则；
     这里显式恢复双栏，保证打印版面与打印通道无关 */
  .collection-head { grid-template-columns: 1fr 1fr; align-items: end; }
  /* 单图条目完整显示，避免裁掉证书与公文的关键内容 */
  .entry-images[data-count="1"] figure { aspect-ratio: auto; background: transparent; }
  .entry-images[data-count="1"] img {
    object-fit: contain; max-height: 68mm; width: auto; max-width: 100%;
    margin: 0 auto; display: block;
  }
  .entry-images figcaption { position: static; background: none; color: #687287; padding: 1mm 0 0; }
  .entry-images .more-count { display: none; }
  a { text-decoration: none; color: inherit; }
}
