@charset "utf-8";

/* ===================== 字体 ===================== */
/* 不再加载 10.7MB 的自定义中文字体：移动端 WebView 解析这么大的字体文件要额外占用几十 MB 内存，
   是页面被系统回收重载的高风险项。改用系统黑体，观感差异很小 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
}

/* ===================== 基础 ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 光标：能点的元素统一手型（窄窗口下手机版也可能被鼠标使用）；
   按钮里的文字/图片跟着父级一起变手型 */
button,
[role="button"] {
  cursor: pointer;
}

button *,
[role="button"] * {
  cursor: inherit;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: #2a1a11;
}

body {
  color: #3b2a1c;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

sup {
  font-size: 0.56em;
  vertical-align: super;
  line-height: 0;
  font-weight: 400;
  /* 上标内部不许断（如 6,13 这种多字符上标） */
  white-space: nowrap;
}

/* 上标不能被挤到下一行行首：在它前面塞一个 word joiner（U+2060）禁止此处断行。
   只加 nowrap 没用，断点在元素边界外面 */
sup::before {
  content: '\2060';
}

/* ===================== 页面 ===================== */
.app {
  position: absolute;
  inset: 0;
}

.page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  /* 切页只做淡入淡出（纯 opacity，不触发整页重新光栅化） */
  transition: opacity 0.32s ease, visibility 0.32s;
}

.page.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* 背景层：只有舞台没铺满屏幕时（宽屏/横屏）才需要它。
   手机竖屏时舞台已经盖住全屏，这层完全看不见，却要算一次整屏高斯模糊 */
.page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg, none) center center / cover no-repeat;
  filter: blur(14px) brightness(0.7) saturate(1.1);
  display: none;
}

html.need-backdrop .page::before {
  display: block;
}

.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 750px;
  height: 1500px;
  margin-left: -375px;
  margin-top: -750px;
  transform: scale(var(--s, 1));
  transform-origin: center center;
}

/* ===================== 图层 ===================== */
.ly {
  position: absolute;
  display: block;
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.txt {
  position: absolute;
  margin: 0;
  font-weight: 400;
  word-break: break-word;
}

/* ---------- 封面 ---------- */
.l-cover-bg      { left: -14.3px;  top: -151.5px; width: 782.6px; height: 1730.2px; }
.l-cover-book-l  { left: -92.3px;  top: 457.2px;  width: 208.1px; height: 208.1px; }
.l-cover-book-r  { left: 566.8px;  top: 138.4px;  width: 239.6px; height: 239.6px; }
.l-cover-plant   { left: -9.6px;  top: 1260px; width: 342px; }
.l-cover-dumbbell{ left: 70.6px;
    top: 357.2px;
    width: 120px; }
.l-cover-tape    {     left: 284.9px;
    top: 116.5px;
    width: 428.2px;
    height: 129.4px; }
.l-cover-sticker { left: 570.3px;  top: 687.0px;  width: 92.4px;  height: 90.0px; }
.l-cover-line    { left: 602px;
    top: 1333px;
    width: 200px; }
.l-cover-btn     { left: 0;        top: 0;        width: 533.1px; height: 88.8px; }
.l-cover-hand    { left: 488.6px;  top: 51.9px;   width: 76.9px;  height: 63.3px; }

.t-cover-title {
  left: 112.8px;
  top: 490px;
  width: 535.2px;
  font-size: 30.25px;
  line-height: 1.56;
  font-weight: 500;
  text-align: center;
  color: #3a2a1e;
  letter-spacing: -1.6px;
}

.t-cover-btn {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 新版按钮文案 22 字，按按钮内宽 533px 反推字号 */
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -1.2px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(120, 0, 0, 0.25);
}

.t-copy-cover {
  right: 12px;
  top: 1160px;
  width: 372px;
  font-size: 8.4px;
  line-height: 1.55;
  text-align: right;
  color: #4f3c2b;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.9), 0 0 12px rgba(255, 255, 255, 0.75);
}

.btn-enter {
  position: absolute;
  left: 108.5px;
  top: 823.5px;
  width: 533.1px;
  height: 88.8px;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.18s ease;
}

.btn-enter:active {
  transform: scale(0.97);
}

/* ---------- 公共：笔记本场景 ---------- */
.l-scene     { left: -53.5px;  top: -7.0px;    width: 859.2px; height: 1526.0px; }
.l-note      { left: -140px; top: 10px; width: 855.0px; }
.l-page      { left: -178px;  top: 140px;   width: 953.0px;  height: 1142.0px; }
.l-organ     { left: 158.6px;  top: 286.3px;   width: 424.0px; height: 847.0px; }
.l-refpaper  { left: 0;top: 0; width: 686.0px; height: 317.1px; }
.l-logo      { left: 32px; top: 140px;   width: 111.1px; height: 65.2px; }
.l-paper     { left: 71.9px;   top: 264.2px;   width: 597.8px; height: 797.3px; }
.l-close     {     left: 595px;
    top: 240px; width: 56px;    height: 56px; }

/* 封面 logo 与内页版式不同，单独定位 */
.page-cover .l-logo { }

.t-copy {
  right: 84px;
  top: 1086px;
  width: 336px;
  font-size: 8px;
  line-height: 1.5;
  text-align: right;
  color: #5d4a38;
}

/* ---------- 器官热点 ---------- */
.organs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.organ {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.o-cc,
.o-ic,
.o-hl {
  position: absolute;
  display: block;
  pointer-events: none;
}

.o-label {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22.05px;
  line-height: 1.12;
  color: #4a3320;
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  
  margin-top: -9px;
}

.o-hot {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
}

/* ---------- 参考文献 ---------- */
.ref-box {
  position: absolute;
  left: 32.0px;
  top: 1111.5px;
  width: 686px;
  height: 317.1px;
}

.ref-text {
  position: absolute;
  left: 55.4px;
  top: 77.2px;
  width: 575.3px;
  height: 185px;
  font-size: 12px;
  line-height: 1.45;
  color: #6a5340;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.ref-text::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.ref-text b {
  font-weight: 700;
  color: #5a3f2b;
}

/* ---------- 弹层：标题 / 按钮 ---------- */
.t-pop-title {
  left: 71.9px;
  top: 240px;
  width: 597.8px;
  height: 90.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46.87px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.042em;
  color: #2f1f14;
  text-align: center;
}

.l-paper-line-detail {  left: 73px; top: 340px; width: 555px; }

/* ---------- 弹层：展开按钮 ---------- */
/* 展开按钮：跟随正文流动，位于可展开内容（圆点条目）的下方 */
.det-btn {
  position: relative;
  display: block;
  width: 420px;
  height: 38.5px;
  margin: 2px auto 16px auto;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.18s ease;
}

.det-btn:active {
  transform: scale(0.97);
}

.l-det-btn-bg2  { left: 0;     top: 0;      width: 100%;   height: 100%; }
.l-det-btn-bg   { left: 0.31%; top: 5.01%;  width: 100%;   height: 100%; }
.l-det-btn-icon {
  left: 2.36%;
  top: 13.03%;
  width: 95.25%;
  height: 74.19%;
  transform-origin: 50% 50%;
  /* 翻转带一点回弹，收起时更利落 */
  transition: transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1);
}

/* 展开后按钮两侧箭头调转方向（朝上） */
.det-item.is-expanded .l-det-btn-icon {
  transform: scaleY(-1);
}

.t-det-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 3px;
  color: #8c2b1c;
}

/* ---------- 弹层：正文 ---------- */
/* top + max-height 应与纸张下半部对齐（当前 500 + 460 = 960，纸张正文底边约 1010） */
.t-det-body {
  position: absolute;
  left: 80px;
  top: 400px;
	width: 557px;
max-height: 670px;
  font-size: 30px;
  line-height: 1.72;
  color: #33241a;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 6px;
}

/* 正文未滚动到底时压在纸张下沿的渐隐提示（颜色取自纸张底色；位置跟随正文区底部） */
.det-fade {
  position: absolute;
  left: 172.8px;
  top: 914px;
  width: 404.4px;
  height: 46px;
  background: linear-gradient(
    to bottom,
    rgba(249, 239, 228, 0) 0%,
    rgba(249, 239, 228, 0.86) 62%,
    rgba(249, 239, 228, 1) 100%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.det-fade.is-on {
  opacity: 1;
}

/* 向上滚动时顶部同样渐隐，避免文字被硬切 */
.det-fade-top {
  top: 500px;
  height: 40px;
  background: linear-gradient(
    to bottom,
    rgba(249, 239, 228, 1) 0%,
    rgba(249, 239, 228, 0.86) 38%,
    rgba(249, 239, 228, 0) 100%
  );
}

.t-det-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ---------- 弹层：一个器官下的多个并发症 ---------- */
/* 点器官直接进详情页，该器官的并发症依次排列：红色小标题 + 条目 */
.det-item + .det-item {
  margin-top: 4px;
}

.det-h {
  position: relative;
  margin: 26px 0 8px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #c33a26;
}

.det-item:first-child .det-h {
  margin-top: 0;
}

/* 三角箭头条目：箭头用设计稿导出的 jiantou.png（63 × 45） */
.det-p {
  position: relative;
  padding-left: 30px;
  margin-bottom: 12px;
}

.det-p::before {
  content: '';
  position: absolute;
  left: 0;
  top: 17px;
  width: 22px;
  height: 16px;
  background: url('../img/jiantou.png?v22') center center / contain no-repeat;
}

/* 详情正文：段落等纸张落位后逐段浮现，避免整块文字一起跳出 */

/* 圆点条目：默认隐藏，点“展开”后出现 */
.det-points {
  list-style: none;
}

.det-points li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
}

.det-points li::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 23px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #000;
}

/* 展开容器：高度动画由 JS 控制（height: 0 ↔ 内容的实际高度），
   比 grid 0fr→1fr 兼容性好，老内核也能过渡，且不会「点了没反应」 */
.det-more-wrap {
  height: 0;
  overflow: hidden;
  transition: height 0.36s cubic-bezier(0.22, 0.68, 0.24, 1);
}

/* 展开时圆点条目逐条浮现 */
.det-item.is-expanded .det-more li {
  animation: pointIn 0.4s cubic-bezier(0.22, 0.68, 0.24, 1) both;
}

.det-item.is-expanded .det-more li:nth-child(2) { animation-delay: 0.07s; }
.det-item.is-expanded .det-more li:nth-child(3) { animation-delay: 0.14s; }
.det-item.is-expanded .det-more li:nth-child(4) { animation-delay: 0.21s; }

/* 条目间距改在 li 上，避免 padding 撑住收起的容器 */
.det-more li:last-child {
  margin-bottom: 16px;
}

/* ---------- 关闭按钮 ---------- */
.btn-close {
  background: url('../img/close.png?v22') center center / 100% 100% no-repeat;
  border: 0;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.18s ease;
}

/* 视觉按设计稿做得小（小屏缩放后约 21~28px），热区向外扩一圈，手指仍然好点 */
.btn-close::after {
  content: '';
  position: absolute;
  inset: -22px;
}

.btn-close:active {
  transform: scale(0.92) rotate(-8deg);
}

/* ===================== 动画 ===================== */
/* 只做一次性入场（transform / opacity），不使用 clip-path、不使用无限循环，
   填充模式统一 backwards：动画结束后元素回到自身默认样式，浏览器可回收合成层 */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInL {
  from { opacity: 0; transform: translateX(-70px) rotate(-4deg); }
  to   { opacity: 1; transform: translateX(0) rotate(0); }
}

@keyframes slideInR {
  from { opacity: 0; transform: translateX(70px) rotate(4deg); }
  to   { opacity: 1; transform: translateX(0) rotate(0); }
}

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.5); }
  70%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes popRot {
  0%   { opacity: 0; transform: scale(0.3) rotate(-30deg); }
  70%  { opacity: 1; transform: scale(1.06) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes organIn {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* 连线由身体向外展开：左右两侧各带一点方向性的位移 */
@keyframes drawInR {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes drawInL {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 高亮条从中心轻轻展开 */
@keyframes hlIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes paperIn {
  0%   { opacity: 0; transform: translateY(-36px) scale(0.96) rotate(-1.4deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

@keyframes pointIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseBtn {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}

@keyframes tapHand {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.92; }
  50%      { transform: translate(-14px, -12px) scale(1.06); opacity: 1; }
}

/* ---------- 通用入场 ---------- */
.stage.enter .anim-fade {
  animation: fadeIn 0.6s ease var(--d, 0s) backwards;
}

.stage.enter .anim-up {
  animation: fadeUp 0.68s cubic-bezier(0.22, 0.8, 0.3, 1) var(--d, 0s) backwards;
}

.stage.enter .anim-down {
  animation: fadeDown 0.62s cubic-bezier(0.22, 0.8, 0.3, 1) var(--d, 0s) backwards;
}

.stage.enter .anim-pop {
  animation: popIn 0.55s cubic-bezier(0.22, 0.9, 0.3, 1.15) var(--d, 0s) backwards;
}

.stage.enter .anim-pop-rot {
  animation: popRot 0.58s cubic-bezier(0.22, 0.9, 0.3, 1.15) var(--d, 0s) backwards;
}

.stage.enter .anim-slide-l {
  animation: slideInL 0.75s cubic-bezier(0.22, 0.8, 0.3, 1) var(--d, 0s) backwards;
}

.stage.enter .anim-slide-r {
  animation: slideInR 0.75s cubic-bezier(0.22, 0.8, 0.3, 1) var(--d, 0s) backwards;
}

.stage.enter .anim-draw {
  animation: fadeIn 0.55s ease var(--d, 0s) backwards;
}

.stage.enter .anim-draw-r {
  animation: drawInR 0.6s cubic-bezier(0.33, 0, 0.2, 1) var(--d, 0s) backwards;
}

.stage.enter .anim-draw-l {
  animation: drawInL 0.6s cubic-bezier(0.33, 0, 0.2, 1) var(--d, 0s) backwards;
}

.stage.enter .anim-hl {
  animation: hlIn 0.5s cubic-bezier(0.22, 0.8, 0.3, 1) var(--d, 0s) backwards;
}

.stage.enter .anim-organ {
  animation: organIn 0.8s cubic-bezier(0.22, 0.8, 0.3, 1) var(--d, 0s) backwards;
}

.stage.enter .anim-paper {
  animation: paperIn 0.6s cubic-bezier(0.22, 0.9, 0.3, 1.05) var(--d, 0s) backwards;
}

/* ---------- 封面：各元素错开落位 ---------- */
.stage.enter .l-cover-book-l {
  animation: slideInL 0.8s cubic-bezier(0.22, 0.8, 0.3, 1) 0.2s backwards;
}

.stage.enter .l-cover-book-r {
  animation: slideInR 0.8s cubic-bezier(0.22, 0.8, 0.3, 1) 0.3s backwards;
}

.page-cover .stage.enter .l-logo {
  animation: fadeIn 0.6s ease 0.35s backwards;
}

.stage.enter .l-cover-plant {
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.8, 0.3, 1) 0.45s backwards;
}

.stage.enter .l-cover-dumbbell {
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.8, 0.3, 1) 0.55s backwards;
}

.stage.enter .l-cover-tape {
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.8, 0.3, 1) 0.65s backwards;
}

.stage.enter .l-cover-sticker {
  animation: popRot 0.65s cubic-bezier(0.22, 0.9, 0.3, 1.15) 0.75s backwards;
}

.stage.enter .t-cover-title {
  animation: fadeUp 0.75s cubic-bezier(0.22, 0.8, 0.3, 1) 0.5s backwards;
}

.stage.enter .l-cover-line {
  animation: fadeIn 0.6s ease 0.85s backwards;
}

.stage.enter .t-copy-cover {
  animation: fadeIn 0.6s ease 1.05s backwards;
}

/* 主按钮：入场后点三下提示，不再无限循环 */
.stage.enter .btn-enter {
  animation: popIn 0.7s cubic-bezier(0.22, 0.9, 0.3, 1.15) 0.95s backwards,
             pulseBtn 2.6s ease-in-out 1.75s 3 both;
}

.stage.enter .l-cover-hand {
  animation: tapHand 1.8s ease-in-out 1.6s 3 both;
}

/* ---------- 人体页 ---------- */
.page-body .stage.enter .l-scene {
  animation: fadeIn 0.6s ease backwards;
}

.page-body .stage.enter .l-note {
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.8, 0.3, 1) 0.05s backwards;
}

.page-body .stage.enter .l-organ {
  animation: organIn 0.85s cubic-bezier(0.22, 0.8, 0.3, 1) 0.3s backwards;
}

.page-body .stage.enter .l-logo {
  animation: fadeIn 0.6s ease 0.25s backwards;
}

.page-body .stage.enter .ref-box {
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.8, 0.3, 1) 0.95s backwards;
}

.page-body .stage.enter .t-copy {
  animation: fadeIn 0.6s ease 1.1s backwards;
}

/* ---------- 弹层页 ---------- */
.page-detail .stage.enter .l-scene {
  animation: fadeIn 0.5s ease backwards;
}

.page-detail .stage.enter .l-note {
  animation: fadeUp 0.6s cubic-bezier(0.22, 0.8, 0.3, 1) 0.04s backwards;
}

.page-detail .stage.enter .l-paper {
  animation: paperIn 0.6s cubic-bezier(0.22, 0.9, 0.3, 1.05) 0.06s backwards;
}

.page-detail .stage.enter .t-pop-title {
  animation: fadeDown 0.6s cubic-bezier(0.22, 0.8, 0.3, 1) 0.16s backwards;
}

.page-detail .stage.enter .l-paper-line-detail {
  animation: fadeIn 0.55s ease 0.3s backwards;
}

.page-detail .stage.enter .btn-close {
  animation: popRot 0.55s cubic-bezier(0.22, 0.9, 0.3, 1.15) 0.24s backwards;
}

.page-detail .stage.enter .l-logo {
  animation: fadeIn 0.55s ease 0.2s backwards;
}

.page-detail .stage.enter .ref-box {
  animation: fadeUp 0.65s cubic-bezier(0.22, 0.8, 0.3, 1) 0.3s backwards;
}

.page-detail .stage.enter .t-copy {
  animation: fadeIn 0.55s ease 0.4s backwards;
}

/* 详情正文：段落逐段浮现 */
.stage.enter .t-det-body {
  animation: fadeIn 0.5s ease 0.1s backwards;
}

/* 详情正文：按并发症块逐块落位（块内不再拆开，长条目也能整块浮现） */
.stage.enter #detailInner > .det-item {
  animation: pointIn 0.5s cubic-bezier(0.22, 0.68, 0.24, 1) var(--d, 0.3s) backwards;
}

/* ===================== 宽屏 ===================== */
@media screen and (min-width: 900px) {
  .page::before {
    filter: blur(38px) brightness(0.55) saturate(1.05);
  }

  /* 舞台上只有宽屏才需要投影：手机上舞台铺满屏幕，阴影完全看不见却要光栅化一次 */
  .stage {
    overflow: hidden;
  }
}
