/* ===================================================================
   Safe Dining（project/safe-dining.html，2026-10-26）。照白皮书自己的视觉：
     墨绿 #3e4c3b（章节页和开屏的底）、奶油 #fbf8f1（内页纸色）、芥黄 #ffb430（章节编号和大字）
     芥黄只放在墨绿上（7.0:1）；奶油底上的强调色用墨绿，不用黄（黄在奶油上只有 1.8:1）
   =================================================================== */
body.is-sd {
  --sd-green: #3e4c3b; --sd-green-d: #323e30; --sd-cream: #fbf8f1; --sd-yel: #ffb430;
  --flag: var(--sd-green);
  background: #ffffff;
}
.is-sd .v2band.is-tint { --paper-warm: #ffffff; background: var(--sd-cream); }
.is-sd .v2band.is-green { background: var(--sd-green); color: var(--sd-cream); }
.is-sd .is-green .pl-n { color: var(--sd-yel); }
.is-sd .is-green .pl-h { color: #ffffff; }
.is-sd .is-green .pl-replay { color: rgba(255, 255, 255, .7); }
.is-sd .pl-h em { font-style: normal; font-weight: 400; color: var(--ink-60); }
.is-sd .is-green .pl-h em { color: var(--sd-yel); }

/* ---------------- 开屏：书直接放在页面上，不垫底（2026-10-26 第二轮，用户说墨绿底和封面糊在一起看不清） ---------------- */
.vxp-hero.sd-hero { position: relative; background: none; border-radius: 0; padding: 0 0 clamp(10px, 1.4vw, 18px); overflow: visible; }

.sdb { position: relative; --ratio: calc(2026 / 1566); --bw: min(100%, calc((100svh - 420px) * 2 * var(--ratio)), 1500px); }
.sdb-stage { position: relative; display: grid; place-items: center; outline: none; }
.sdb-stage:focus-visible .sdb-book { outline: 2px solid var(--sd-yel); outline-offset: 10px; }
/* 跨页宽 = 2 × 单页；高度不超过一屏减去顶栏、标题和下面那条控制栏 */
.sdb-book {
  position: relative; width: var(--bw); aspect-ratio: calc(2 * 2026) / 1566;
  perspective: 2800px; transition: transform .75s var(--ease); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
}
.sdb-book.is-drag { cursor: grabbing; }
.sdb-book.is-front { transform: translateX(-25%); }
.sdb-book.is-back { transform: translateX(25%); }
/* 书下面的影子，跟着露出来的那一半走 */
.sdb-book::before {
  content: ''; position: absolute; z-index: 0; top: 2%; bottom: -1%; left: 0; right: 0; border-radius: 6px;
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .55), 0 10px 18px -8px rgba(0, 0, 0, .35); transition: left .75s var(--ease), right .75s var(--ease);
}
.sdb-book.is-front::before { left: 50%; }
.sdb-book.is-back::before { right: 50%; }

.sdb-static { position: absolute; left: 50%; top: 0; width: 50%; height: 100%; object-fit: cover; }
.sdb-leaf { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; transform-origin: 0 50%; transform-style: preserve-3d; will-change: transform; }
.sdb-leaf.is-far { visibility: hidden; }
.sdb-face { position: absolute; inset: 0; overflow: hidden; background: var(--sd-cream); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.sdb-face.is-back { transform: rotateY(180deg); }
.sdb-face img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* 书脊那一侧的折痕阴影 */
.sdb-face::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.sdb-face.is-front::before { background: linear-gradient(90deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, .06) 3%, transparent 9%); }
.sdb-face.is-back::before { background: linear-gradient(270deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, .06) 3%, transparent 9%); }
/* 翻动时的明暗 */
.sdb-face::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; }
.sdb-leaf.is-moving .sdb-face::after { opacity: 1; }
.sdb-face.is-front::after { background: linear-gradient(90deg, rgba(0, 0, 0, calc(var(--sf, 0) * .5)), rgba(0, 0, 0, var(--sf, 0))); }
.sdb-face.is-back::after { background: linear-gradient(270deg, rgba(0, 0, 0, calc(var(--sb, 0) * .5)), rgba(0, 0, 0, var(--sb, 0))); }

/* 章节在书上面一行；书下面左边是页码，右下角一组：上一页 / 下一页 / 放大读 */
.sdb-ch { display: flex; justify-content: center; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 auto clamp(14px, 1.8vw, 22px); max-width: 100%; }
.sdb-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: var(--bw, 100%); max-width: 100%; margin: clamp(16px, 2vw, 24px) auto 0; }
.sdb-ctl { display: flex; align-items: center; gap: 8px; flex: none; }
.sdb-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #f1efe9; color: var(--ink); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), opacity .2s var(--ease);
}
.sdb-btn svg { width: 20px; height: 20px; }
.sdb-btn:hover:not(:disabled) { background: var(--sd-green); color: #ffffff; }
.sdb-btn:disabled { opacity: .3; cursor: default; }
.sdb-btn:focus-visible, .sdb-ch button:focus-visible, .sdb-read:focus-visible { outline: 2px solid var(--sd-green); outline-offset: 2px; }
.sdb-ch::-webkit-scrollbar { display: none; }
.sdb-ch button {
  flex: none; padding: 9px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-60);
  font: 500 14px/1 var(--f-ui); letter-spacing: -.01em; cursor: pointer; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease);
}
.sdb-ch button b { font-weight: 600; color: var(--sd-green); margin-right: 6px; }
.sdb-ch button:hover { color: var(--ink); background: #f4f2ec; }
.sdb-ch button[aria-current="true"] { background: var(--sd-green); color: #ffffff; }
.sdb-ch button[aria-current="true"] b { color: var(--sd-yel); }
.sdb-count { min-width: 0; margin: 0; font: 500 14px/1.3 var(--f-ui); color: var(--ink-45); white-space: nowrap; overflow: hidden; }
.sdb-count b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.sdb-count span { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--ink-80); }
.sdb-read {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--sd-green); color: #ffffff; font: 600 14.5px/1 var(--f-ui); cursor: pointer; transition: transform .2s var(--ease), background .2s var(--ease);
}
.sdb-read:hover { transform: translateY(-1px); background: var(--sd-green-d); }
.sdb-read .pl-ic { width: 18px; height: 18px; vertical-align: 0; }

/* 窄屏：单页横滑条 */
.sdb-strip { display: none; }
.sdb.is-single .sdb-book { display: none; }
.sdb.is-single .sdb-strip {
  display: flex; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 4px;
  box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .55); overscroll-behavior-x: contain;
}
.sdb-strip::-webkit-scrollbar { display: none; }
.sdb-strip img { flex: 0 0 100%; width: 100%; height: auto; aspect-ratio: 2026 / 1566; object-fit: cover; scroll-snap-align: start; background: var(--sd-cream); }
.sdb.is-single .sdb-stage { display: block; }
@media (max-width: 520px) {
  .sdb-read span { display: none; }
  .sdb-read { width: 44px; padding: 0; justify-content: center; }
}

/* 放大读 */
.sdz { padding: 0; border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: transparent; }
.sdz::backdrop { background: #1b2219; }
.sdz[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.sdz-view { position: relative; overflow: hidden; touch-action: none; cursor: grab; margin: 16px 16px 0; }
.sdz-view:active { cursor: grabbing; }
.sdz-in, .sdp-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.sdz-in { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.sdz-in img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; background: var(--sd-cream); }
.is-anim { transition: transform .9s cubic-bezier(.45, 0, .2, 1); }
.sdz-bar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 16px 18px; color: var(--sd-cream); }
.sdz-bar .sdb-count { text-align: center; min-width: 16ch; color: rgba(255, 255, 255, .6); }
.sdz-bar .sdb-count b, .sdz-bar .sdb-count span { color: #ffffff; }
.sdz .sdb-btn { background: rgba(255, 255, 255, .12); color: #ffffff; }
.sdz-zoom { display: flex; gap: 6px; }
.sdz-x { position: fixed; top: 18px; right: 18px; z-index: 2; }

/* ---------------- 海报看图器 ---------------- */
.sdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: clamp(16px, 2.4vw, 32px); align-items: start; }
.sdp-view {
  position: relative; overflow: hidden; aspect-ratio: 11400 / 7200; border-radius: 16px; background: #f4efe3;
  touch-action: pan-y; cursor: grab; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 30px 60px -40px rgba(30, 40, 20, .5);
}
.sdp-view.is-zoomed { touch-action: none; }
.sdp-view:active { cursor: grabbing; }
.sdp-in img { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.sdp-zoom { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: flex; gap: 6px; }
.sdp-zoom .sdb-btn { width: 40px; height: 40px; background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .4); }
.sdp-zoom .sdb-btn:hover { background: var(--sd-green); color: #ffffff; }
.sdp-tour { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: sd; }
.sdp-tour button {
  position: relative; width: 100%; padding: 13px 16px 13px 50px; border: 0; border-radius: 16px; background: transparent; color: var(--ink-60);
  text-align: left; cursor: pointer; font: 400 14.5px/1.4 var(--f-ui); transition: background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.sdp-tour button b { display: block; margin-bottom: 2px; font-weight: 600; font-size: 16px; color: var(--ink); }
.sdp-tour li:not(:last-child) button::before {
  counter-increment: sd; content: counter(sd); position: absolute; left: 14px; top: 13px; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .07); color: var(--ink-60); font: 600 12.5px/1 var(--f-ui);
}
.sdp-tour li:last-child button::before {
  content: ''; position: absolute; left: 16px; top: 15px; width: 18px; height: 18px; border: 1.8px solid var(--ink-45); border-radius: 4px;
}
.sdp-tour button:hover { color: var(--ink); }
.sdp-tour button[aria-pressed="true"] { background: #ffffff; color: var(--ink-80); box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 14px 28px -20px rgba(30, 40, 20, .5); }
.sdp-tour button[aria-pressed="true"]::before { background: var(--sd-green); color: var(--sd-yel); border-color: var(--sd-green); }
.sdp-tour button:focus-visible { outline: 2px solid var(--sd-green); outline-offset: 2px; }
@media (max-width: 900px) {
  .sdp { grid-template-columns: minmax(0, 1fr); }
  .sdp-tour { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sdp-tour button span { display: none; }
  .sdp-tour button { padding-block: 12px; }
}

/* ---------------- 研究方法：书里的那几页，点了翻过去 ---------------- */
.sd-pages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); }
.sd-page { display: grid; gap: 12px; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.sd-page-img { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 2026 / 1566; background: var(--sd-cream);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 18px 36px -24px rgba(30, 40, 20, .55); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.sd-page-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sd-page-img::after {
  content: 'Open in the book →'; position: absolute; left: 12px; bottom: 12px; padding: 8px 12px; border-radius: 999px; background: var(--sd-green); color: #ffffff;
  font: 600 13px/1 var(--f-ui); opacity: 0; transform: translateY(6px); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.sd-page:hover .sd-page-img, .sd-page:focus-visible .sd-page-img { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 28px 44px -24px rgba(30, 40, 20, .6); }
.sd-page:hover .sd-page-img::after, .sd-page:focus-visible .sd-page-img::after { opacity: 1; transform: none; }
.sd-page:focus-visible { outline: none; }
.sd-page:focus-visible .sd-page-img { outline: 2px solid var(--sd-green); outline-offset: 3px; }
.sd-page-t { font: 600 17px/1.3 var(--f-ui); letter-spacing: -.01em; }
.sd-page-t b { font-weight: 600; color: var(--sd-green); }
.sd-page-d { display: block; margin-top: 3px; font-weight: 400; font-size: 15px; color: var(--ink-60); }
@media (hover: none) { .sd-page-img::after { opacity: 1; transform: none; } }
@media (max-width: 900px) { .sd-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .sd-pages { grid-template-columns: 1fr; } }

/* ---------------- 六个机会点：墨绿带上的卡片 ---------------- */
.sd-fixes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.sd-fix {
  display: grid; grid-template-rows: auto 1fr auto; gap: 14px; width: 100%; height: 100%; padding: clamp(20px, 2.2vw, 28px); border: 0; border-radius: 22px;
  background: rgba(255, 255, 255, .06); color: inherit; text-align: left; cursor: pointer; transition: background .3s var(--ease), transform .3s var(--ease);
}
.sd-fix:hover { background: rgba(255, 255, 255, .11); transform: translateY(-3px); }
.sd-fix:focus-visible { outline: 2px solid var(--sd-yel); outline-offset: 3px; }
.sd-fix-n { font: 400 clamp(40px, 4vw, 56px)/1 var(--f-display); letter-spacing: -.03em; color: var(--sd-yel); }
.sd-fix-t { font: 500 clamp(19px, 1.7vw, 22px)/1.25 var(--f-display); letter-spacing: -.015em; color: #ffffff; }
.sd-fix-b { display: block; margin-top: 10px; font: 400 15px/1.45 var(--f-ui); color: rgba(255, 255, 255, .7); }
.sd-fix-go { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--f-ui); color: var(--sd-yel); }
.sd-fix-go .pl-ic { width: 16px; height: 16px; vertical-align: 0; }
@media (max-width: 900px) { .sd-fixes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sd-fixes { grid-template-columns: 1fr; } }

/* 团队署名 */
.sd-team { margin-top: clamp(28px, 3.6vw, 44px); font: 400 15px/1.5 var(--f-ui); color: rgba(255, 255, 255, .7); }
.sd-team b { font-weight: 600; color: #ffffff; }

/* ---------------- 03 工作坊照片 ---------------- */
.sd-photos { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(12px, 1.6vw, 20px); margin-bottom: clamp(28px, 3.6vw, 44px); }
.sd-photos figure { margin: 0; display: grid; gap: 10px; }
.sd-photos img { width: 100%; height: clamp(300px, 34vw, 540px); object-fit: cover; border-radius: 18px; }
.sd-photos figure:last-child img { object-position: 50% 35%; }
.sd-photos figcaption { font: 500 15px/1.4 var(--f-ui); color: var(--ink-60); }
@media (max-width: 760px) { .sd-photos { grid-template-columns: minmax(0, 1fr); } .sd-photos img { height: auto; aspect-ratio: 4 / 3; } }

/* 演示手指（.pl-ptr）别把整页撑宽 */
.sd-hero { overflow-x: clip; }

/* ---------- 一屏看全（2026-10-26） ----------
   --fit = 视口 − 顶栏 − 这一节标题（js/v2.js）。研究下的书页已经拆成自己一节（#pages，见 html）。 */
@media (min-width: 981px) {
  /* 03 书页：两行三列按可用高度定宽 */
  .sd-pages { max-width: min(100%, calc((var(--fit) - 170px) / 2 * 1.294 * 3 + 52px)); margin-inline: auto; }
  .sd-photos { margin-bottom: 0; }
  .sd-photos img { max-height: calc(var(--fit) - 40px); object-fit: cover; }
  /* 01 / 02 两张海报：画面按可用高度定宽（海报 11400:7200） */
  .sdp-view { width: min(100%, calc(var(--fit) * 1.583)); justify-self: end; }
}
/* 矮屏：海报导览和六张机会卡收矮一点 */
@media (min-width: 981px) and (max-height: 780px) {
  .sdp-tour button { padding-block: 9px; }
  .sdp-tour li:not(:last-child) button::before { top: 9px; }
  .sdp-tour li:last-child button::before { top: 11px; }
  .sd-fix { padding-block: 16px; gap: 6px; }
  .sd-fix-n { font-size: 36px; }
  .sd-fix-b { margin-top: 6px; }
}
