/* ==========================================================================
   圣地巡礼 · 顶部统一卡片
   左：打卡次数 / 狗爪进度条 / 已打卡数量（popo 模块注入）
   右：照片广场入口（三张叠放拍立得 + 标题 + 右上箭头）
   只有一层卡片外壳；右侧是无边框内嵌入口，靠雾蓝底色反馈说明可点。
   插画为内联 SVG，颜色走 --pgpc-* 变量。
   ========================================================================== */

/* ---------- 外层：唯一一层卡片 ---------- */

#popoPgProgress {
  --pg-tb-surface: rgba(255, 253, 247, .82);
  --pg-tb-border: rgba(66, 86, 116, .12);
  --pg-tb-rule: rgba(66, 86, 116, .26);
  --pg-tb-shadow:
    0 1px 2px rgba(38, 48, 68, .04),
    0 14px 30px -22px rgba(38, 48, 68, .30);
  --pg-tb-hover: rgba(201, 220, 242, .40);
  --pg-tb-hover-strong: rgba(196, 216, 241, .52);

  /* 入口文字与插画配色：低饱和雾蓝 / 奶油白 / 浅金 */
  --pgpc-ink: #2b3348;
  --pgpc-muted: #9aa3b2;
  --pgpc-gold: #c2a877;
  --pgpc-sky-a: #d7e2ef;
  --pgpc-sky-b: #f7f3e8;
  --pgpc-ridge-a: #9db3cf;
  --pgpc-ridge-b: #7f97b8;
  --pgpc-ridge-c: #bccbdd;
  --pgpc-sun: #ddc596;
  --pgpc-frame: #fdfbf5;
  --pgpc-frame-edge: rgba(255, 255, 255, .95);

  position: relative;
  display: flex;
  align-items: stretch;
  margin: 18px 0 16px;
  padding: 0;
  min-height: 104px;
  border: 1px solid var(--pg-tb-border);
  border-radius: 18px;
  background: var(--pg-tb-surface);
  box-shadow: var(--pg-tb-shadow);
  overflow: hidden;
  -webkit-backdrop-filter: blur(9px) saturate(1.04);
  backdrop-filter: blur(9px) saturate(1.04);
  font-family: var(--popo-font);
}

/* 顶部一条极淡的玻璃高光，让卡片有厚度而不是一块纯色 */
#popoPgProgress::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95) 20%, rgba(255, 255, 255, .95) 80%, transparent);
  opacity: .8;
  pointer-events: none;
  z-index: 2;
}

/* ---------- 左：打卡进度（约 75%） ---------- */

.pg-tb-progress {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 22px;
}

#popoPgProgress .popo-pg-head {
  margin-bottom: 10px;
  gap: 10px;
}

#popoPgProgress .popo-pg-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--popo-ink);
}

#popoPgProgress .popo-pg-loading {
  font-size: 12px;
  color: var(--popo-ink-muted);
}

#popoPgProgress #popoPgTrack {
  height: 7px;
  background: rgba(66, 86, 116, .09);
}

#popoPgProgress #popoPgSplit {
  margin-top: 9px;
  font-size: 12px;
  color: #7c8598;
  letter-spacing: .2px;
}

#popoPgProgress .popo-pg-guest,
#popoPgProgress .popo-pg-error {
  margin-top: 9px;
  font-size: 12.5px;
}

/* ---------- 短而极淡的竖向分隔线（不贯穿卡片） ---------- */

.pg-tb-rule {
  flex: 0 0 1px;
  align-self: center;
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg,
    rgba(66, 86, 116, 0) 0%,
    var(--pg-tb-rule) 50%,
    rgba(66, 86, 116, 0) 100%);
}

/* ---------- 右：照片广场入口（约 25%，无边框内嵌） ---------- */

.pg-tb-plaza {
  position: relative;
  /* 常规约 25%；窄屏时按内容撑开，宁可略宽也不截断标题 */
  flex: 0 0 auto;
  min-width: 25%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* 雾蓝反馈用一层内嵌底色，可淡入淡出；不是卡片，没有边框和阴影 */
.pg-tb-plaza::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg,
    rgba(201, 220, 242, 0) 0,
    var(--pg-tb-hover) 26px,
    var(--pg-tb-hover) 100%);
  opacity: 0;
  transition: opacity .28s ease;
  pointer-events: none;
  z-index: 0;
}

/* 内容压在底色之上 */
.pg-tb-plaza > * { position: relative; z-index: 1; }

/* 三张叠放的拍立得 */
.pg-pc-stack {
  position: relative;
  flex: 0 0 auto;
  width: 92px;
  height: 60px;
}

.pg-pc-polaroid {
  position: absolute;
  display: block;
  width: 42px;
  padding: 2.5px 2.5px 7px;
  border-radius: 2.5px;
  background: var(--pgpc-frame);
  box-shadow:
    0 1px 1px rgba(38, 48, 68, .10),
    0 6px 14px -9px rgba(38, 48, 68, .34),
    inset 0 0 0 1px var(--pgpc-frame-edge);
  transition: transform .34s cubic-bezier(.22, .68, .28, 1), box-shadow .34s ease;
  will-change: transform;
}

.pg-pc-polaroid svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.5px;
}

/* 中间那张压在最上，左右两张各露出约六成画幅 */
.pg-pc-p1 { left: 0;   top: 6px; z-index: 1; transform: rotate(-9deg); }
.pg-pc-p2 { left: 25px; top: 0;  z-index: 3; transform: rotate(2deg); }
.pg-pc-p3 { left: 50px; top: 7px; z-index: 2; transform: rotate(11deg); }

.pg-pc-title {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--pgpc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 箭头跟在标题右侧偏上，不单独占一栏 */
.pg-tb-plaza .pg-pc-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: -3px;
  margin-top: -9px;
  color: var(--pgpc-muted);
  transition: transform .26s cubic-bezier(.22, .68, .28, 1), color .26s ease;
}

.pg-tb-plaza .pg-pc-arrow svg { display: block; width: 16px; height: 16px; }

/* ---------- 悬浮：右侧雾蓝底 + 拍立得轻微展开 ---------- */

@media (hover: hover) {
  /* 左缘淡入，避免在分隔线处出现一条硬边 */
  .pg-tb-plaza:hover::after { opacity: 1; }
  .pg-tb-plaza:hover .pg-pc-p1 { transform: rotate(-13deg) translateX(-5px) translateY(-1px); }
  .pg-tb-plaza:hover .pg-pc-p3 { transform: rotate(16deg) translateX(4px) translateY(-2px); }
  .pg-tb-plaza:hover .pg-pc-p2 {
    transform: rotate(0deg) translateY(-2px);
    box-shadow:
      0 1px 1px rgba(38, 48, 68, .10),
      0 10px 20px -10px rgba(38, 48, 68, .38),
      inset 0 0 0 1px var(--pgpc-frame-edge);
  }
  .pg-tb-plaza:hover .pg-pc-arrow {
    color: var(--pgpc-gold);
    transform: translate(2px, -2px);
  }
}

.pg-tb-plaza:active::after {
  opacity: 1;
  background-image: linear-gradient(90deg,
    rgba(196, 216, 241, 0) 0,
    var(--pg-tb-hover-strong) 26px,
    var(--pg-tb-hover-strong) 100%);
}

.pg-tb-plaza:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(194, 168, 119, .42);
}
.pg-tb-plaza:focus-visible::after { opacity: 1; }

/* ---------- 平板：入口收窄，插画随之缩小 ---------- */

@media (max-width: 1080px) and (min-width: 901px) {
  .pg-tb-progress { padding: 15px 18px; }
  .pg-tb-plaza { gap: 10px; padding: 0 14px; }
  .pg-pc-stack { width: 84px; height: 56px; }
  .pg-pc-polaroid { width: 38px; padding: 2px 2px 6px; }
  .pg-pc-p1 { left: 0;   top: 5px; transform: rotate(-9deg); }
  .pg-pc-p2 { left: 23px; top: 0;  transform: rotate(2deg); }
  .pg-pc-p3 { left: 46px; top: 6px; transform: rotate(11deg); }
  .pg-pc-title { font-size: 13.5px; }
  .pg-tb-plaza .pg-pc-arrow { width: 20px; height: 20px; margin-left: -2px; margin-top: -8px; }
  .pg-tb-plaza .pg-pc-arrow svg { width: 15px; height: 15px; }
}

@media (max-width: 900px) and (min-width: 761px) {
  .pg-tb-progress { padding: 14px 16px; }
  .pg-tb-plaza { gap: 9px; padding: 0 10px; }
  .pg-pc-stack { width: 76px; height: 52px; }
  .pg-pc-polaroid { width: 34px; padding: 2px 2px 5.5px; }
  .pg-pc-p1 { left: 0;   top: 5px; transform: rotate(-8deg); }
  .pg-pc-p2 { left: 21px; top: 0;  transform: rotate(2deg); }
  .pg-pc-p3 { left: 42px; top: 6px; transform: rotate(10deg); }
  .pg-pc-title { font-size: 13px; }
  .pg-tb-plaza .pg-pc-arrow { width: 19px; height: 19px; margin-left: -2px; margin-top: -8px; }
  .pg-tb-plaza .pg-pc-arrow svg { width: 14px; height: 14px; }
}

/* ---------- 窄屏：同一张卡片内改成上下布局 ---------- */

@media (max-width: 760px) {
  #popoPgProgress {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    margin: 14px 0 14px;
    border-radius: 16px;
  }
  .pg-tb-progress { padding: 14px 16px 13px; }

  .pg-tb-rule {
    flex: 0 0 1px;
    align-self: stretch;
    width: auto;
    height: 1px;
    margin: 0 16px;
    background: linear-gradient(90deg,
      rgba(66, 86, 116, 0) 0%,
      var(--pg-tb-rule) 50%,
      rgba(66, 86, 116, 0) 100%);
  }

  .pg-tb-plaza {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px 13px;
  }
  .pg-pc-stack { width: 88px; height: 58px; }
  .pg-pc-polaroid { width: 40px; padding: 2.5px 2.5px 6.5px; }
  .pg-pc-p1 { left: 0;   top: 6px; transform: rotate(-9deg); }
  .pg-pc-p2 { left: 24px; top: 0;  transform: rotate(2deg); }
  .pg-pc-p3 { left: 48px; top: 7px; transform: rotate(11deg); }
  .pg-pc-title { font-size: 14px; }
  .pg-tb-plaza .pg-pc-arrow { margin-left: -2px; margin-top: -9px; }
}

@media (max-width: 380px) {
  .pg-pc-stack { width: 80px; }
  .pg-pc-polaroid { width: 37px; }
  .pg-pc-p1 { left: 0; }
  .pg-pc-p2 { left: 22px; }
  .pg-pc-p3 { left: 44px; }
}

/* ---------- 夜间模式 ----------
   巡礼页本体没有夜间主题（页面与外壳样式表均无深色定义），
   这里只在系统深色下把奶油白压深一档、边框略提，避免浅色块在暗环境里发晃，
   不会出现「浅色页面中间一块深色卡片」。 */

@media (prefers-color-scheme: dark) {
  #popoPgProgress {
    --pg-tb-surface: rgba(250, 247, 239, .9);
    --pg-tb-border: rgba(66, 86, 116, .2);
    --pg-tb-shadow:
      0 1px 2px rgba(20, 26, 40, .1),
      0 16px 32px -22px rgba(20, 26, 40, .4);
    --pg-tb-hover: rgba(196, 215, 240, .42);
    --pg-tb-hover-strong: rgba(190, 211, 238, .58);
    --pgpc-ink: #242c3e;
  }
  #popoPgProgress::before { opacity: .45; }
}

/* ---------- 尊重减少动效 ---------- */

@media (prefers-reduced-motion: reduce) {
  .pg-pc-polaroid,
  .pg-pc-arrow,
  .pg-tb-plaza { transition: none !important; }
  .pg-tb-plaza:hover .pg-pc-p1 { transform: rotate(-9deg); }
  .pg-tb-plaza:hover .pg-pc-p2 { transform: rotate(2deg); }
  .pg-tb-plaza:hover .pg-pc-p3 { transform: rotate(11deg); }
  .pg-tb-plaza:hover .pg-pc-arrow { transform: none; }
}
