/* 下载页（/download）的 v2 版式。
 * 只在 v2/style.css 之后追加本页的排版，配色、字体、笔触、颜料按钮、刊头与页脚全部沿用 v2 共用规则，不在这里另造一套。
 * 本页不加载 v2/main.js（那是首页画板的脚本），进场动效由页内一小段脚本给 [data-rv] 加 .is-in。 */

.dlp main { padding-top: 116px; }

/* ── 信纸：她写给正在下载的你 ─────────────────────────────── */
.dlp-desk {
  display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.68fr);
  gap: clamp(36px, 5vw, 84px); align-items: center;
}
.dlp-letter {
  position: relative; padding: clamp(44px, 4vw, 60px) clamp(32px, 4.2vw, 64px) clamp(32px, 3vw, 44px);
  background: url("img/letter-paper.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 18px 24px rgba(60, 40, 25, 0.16));
  transform: rotate(-0.6deg);
}
.dlp-postmark {
  position: absolute; top: 26px; right: 30px; width: clamp(70px, 7vw, 96px); aspect-ratio: 1;
  background: url("img/postmark.webp") center / contain no-repeat; opacity: 0.78; transform: rotate(10deg); pointer-events: none;
}
.dlp-greet { font-family: var(--hand); font-size: clamp(17px, 1.4vw, 20px); color: var(--rose); }
.dlp-title { margin-top: 12px; font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.45; letter-spacing: 0.04em; }
.dlp-title span { display: block; }
.dlp-title span:last-child { white-space: nowrap; }
.dlp-sub { margin-top: 10px; font-family: var(--hand); font-size: clamp(18px, 1.5vw, 22px); color: var(--ink-soft); }

.dlp-label { display: flex; align-items: baseline; gap: 12px; margin-top: clamp(22px, 2.2vw, 30px); }
.dlp-label .en { font-family: var(--latin); font-style: italic; font-size: 19px; color: var(--rose); }
.dlp-label b { font-family: var(--serif); font-weight: 600; font-size: 15px; letter-spacing: 0.08em; }
.dl-ver { font-family: var(--latin); font-style: italic; font-size: 16px; color: var(--ink-soft); }
.dl-ver:empty { display: none; }
/* 卖点：原来是吊在拍立得下面的牛皮纸吊牌，视觉上与信纸脱节，现在收成标题行末尾的一行手写小字 */
.dlp-points { margin-left: auto; font-family: var(--hand); font-size: 14px; color: var(--ink-soft); white-space: nowrap; }

/* 下载按钮：三个平台同款墨色颜料块、等宽并排，不分主次。v2 共用的 .dl-btn 用 cqw 定尺寸（画板里用），这里改回固定尺寸 */
.dlp-desktop { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; isolation: isolate; }
.dlp .dl-main { justify-content: flex-start; gap: 10px; height: 72px; min-height: 0; min-width: 0; padding: 0 12px 0 20px; font-size: 16px; white-space: nowrap; }
.dl-ico { flex: none; display: grid; place-items: center; opacity: 0.92; transition: transform 0.25s; }
.dl-main:hover .dl-ico { transform: translateY(2px); }
.dl-t { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; text-align: left; min-width: 0; }
.dl-t b { font-weight: 600; letter-spacing: 0.03em; }
.dl-t small { margin-top: 3px; font-family: var(--sans); font-size: 12px; letter-spacing: 0.02em; color: rgba(246, 238, 228, 0.8); }
.dl-main:hover .dl-t small { color: #fff; }

.dlp-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-top: 16px; }
.dlp-chip { font-family: var(--hand); font-size: 15px; color: var(--ink-soft); }
.dlp-to-phone { display: none; margin-top: 14px; }
.dlp-sign { margin-left: auto; font-family: var(--hand); font-size: clamp(16px, 1.4vw, 19px); color: var(--rose); }
.dlp-sign i { font-family: var(--latin); font-style: italic; }

/* ── 拍立得与吊牌 ─────────────────────────────────────────── */
.dlp-photo { display: flex; flex-direction: column; align-items: center; }
.dlp-pol {
  position: relative; width: min(100%, 340px); aspect-ratio: var(--frame-ar);
  transform: rotate(3.5deg); transform-origin: 50% 4%;
  filter: drop-shadow(0 16px 20px rgba(60, 40, 25, 0.2));
}
.dlp-pol-photo { position: absolute; left: var(--win-l); top: var(--win-t); right: var(--win-r); bottom: var(--win-b); overflow: hidden; background: #E6D6C2; }
.dlp-pol-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%; }
.dlp-pol-frame { position: absolute; inset: 0; background: url("img/polaroid.webp") center / 100% 100% no-repeat; }
.dlp-pol figcaption {
  position: absolute; left: 9%; right: 6%; bottom: 4%; height: calc(var(--win-b) - 5%);
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  font-family: var(--hand); font-size: clamp(16px, 1.35vw, 19px); line-height: 1.3;
}
.dlp-pol figcaption b { font-family: var(--latin); font-style: italic; font-weight: 600; font-size: 1.05em; color: var(--ink-soft); }
/* ── 章节标题 ─────────────────────────────────────────────── */
.dlp-sec { padding-top: clamp(52px, 6vw, 84px); }
.dlp-head { display: flex; align-items: baseline; gap: 18px; }
.dlp-head .en { font-family: var(--latin); font-style: italic; font-size: clamp(18px, 1.6vw, 22px); color: var(--rose); white-space: nowrap; }
.dlp-head h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 2.4vw, 32px); letter-spacing: 0.05em; white-space: nowrap; }
.dlp-head .stroke-rule { flex: 1; max-width: 340px; height: 9px; align-self: center; }

/* ── 手机版：三张便签 ─────────────────────────────────────── */
.dlp-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(24px, 3vw, 44px); margin-top: 28px; }
.dlp-note {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  justify-self: center; width: min(100%, 270px); min-height: 0; padding: 40px 20px 26px;
  background: var(--note) center / 100% 100% no-repeat; transform: rotate(var(--r, 0deg));
  filter: drop-shadow(0 10px 12px rgba(60, 40, 25, 0.16));
  transition: transform 0.3s, filter 0.3s;
}
.dlp-note-android { --note: url("img/note-3.webp"); --r: -2deg; }
.dlp-note-ios { --note: url("img/note-5.webp"); --r: 1.5deg; --d: 0.1s; }
.dlp-note-web { --note: url("img/note-2.webp"); --r: -1deg; --d: 0.2s; }
a.dlp-note:hover { transform: rotate(0deg) translateY(-4px); filter: drop-shadow(0 16px 18px rgba(60, 40, 25, 0.22)); }
.dlp-note h3 { margin-top: 14px; font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: 0.06em; }
.dlp-note p { margin-top: 4px; font-family: var(--hand); font-size: 15px; color: var(--ink-soft); }
a.dlp-note:hover h3 { color: var(--rose-deep); }
.dlp-qr { width: 120px; height: 120px; padding: 7px; background: #fff; box-shadow: 0 0 0 1px rgba(42, 35, 32, 0.1), 0 4px 10px rgba(60, 40, 25, 0.08); object-fit: contain; }
.dlp-soon, .dlp-web {
  display: grid; place-items: center; width: 120px; height: 120px;
  border: 1.5px dashed rgba(42, 35, 32, 0.26); font-family: var(--hand); font-size: 18px; color: var(--ink-soft);
}
.dlp-web { border-style: solid; border-color: rgba(168, 71, 90, 0.35); color: var(--rose); }

/* ── 第一次打开时：三张牛皮纸条 ───────────────────────────── */
.dlp-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(20px, 2.6vw, 36px); margin-top: 28px; }
.dlp-kraft {
  position: relative; display: flex; flex-direction: column; min-height: 0; padding: 44px 28px 32px 30px;
  background: url("img/wall-note.webp") center / 100% 100% no-repeat; transform: rotate(var(--r, 0deg));
  filter: drop-shadow(0 10px 12px rgba(60, 40, 25, 0.18));
  font-size: 14px; line-height: 1.75; color: #4A3A2E;
}
.dlp-kraft h3 { margin-bottom: 8px; font-family: var(--serif); font-weight: 600; font-size: 16px; letter-spacing: 0.04em; color: var(--ink); }
.dlp-kraft b { font-weight: 600; color: var(--rose-deep); }
.dlp-cmd {
  display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px 6px 6px 12px;
  background: rgba(251, 248, 241, 0.72); border: 1px dashed rgba(74, 58, 46, 0.35);
}
.dlp-cmd code { flex: 1; min-width: 0; overflow-wrap: break-word; line-height: 1.6; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink); }
.dlp-copy { flex: none; display: grid; place-items: center; width: 30px; height: 30px; color: var(--ink-soft); transition: color 0.2s; }
.dlp-copy:hover { color: var(--rose); }
.dlp-copy svg[hidden] { display: none; }
.dlp-kraft .pen-link { align-self: flex-start; margin-top: auto; padding-top: 14px; font-size: 15px; }

/* ── 背景音乐按钮：贴在右下角的一张小纸片 ─────────────────── */
.bgm {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow-paper);
  font-family: var(--hand); font-size: 14px; color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
}
.bgm:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.bgm[hidden] { display: none; }
.bgm-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--rose); color: #FBF3EA; }
.bgm-ico .bars { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.bgm-ico .bars i { width: 3px; height: 40%; border-radius: 2px; background: currentColor; animation: bgmBar 0.9s ease-in-out infinite; }
.bgm-ico .bars i:nth-child(2) { animation-delay: -0.3s; }
.bgm-ico .bars i:nth-child(3) { animation-delay: -0.6s; }
.bgm.on .bgm-ico svg { display: none; }
.bgm.on .bgm-ico .bars { display: inline-flex; }
@keyframes bgmBar { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* ── 加群二维码弹窗：遮罩与卡片分别过渡 ───────────────────── */
.qr-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(42, 35, 32, 0.38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.qr-overlay.open { opacity: 1; pointer-events: auto; }
.qr-modal {
  position: relative; width: min(340px, 100%); padding: 42px 30px 28px; text-align: center;
  background: url("img/letter-paper.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 24px 36px rgba(40, 25, 15, 0.28));
  transform: translateY(16px) rotate(-1deg) scale(0.97); transition: transform 0.35s var(--rv-spring, ease);
}
.qr-overlay.open .qr-modal { transform: rotate(-1deg); }
.qr-modal .tape { top: -14px; width: 104px; height: 28px; }
.qr-modal-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--ink-soft); transition: color 0.2s, background 0.2s; }
.qr-modal-close:hover { color: var(--rose); background: rgba(168, 71, 90, 0.08); }
.qr-modal-title { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: 0.06em; }
.qr-modal-sub { margin-top: 4px; font-family: var(--hand); font-size: 15px; color: var(--ink-soft); }
.qr-modal-frame { margin: 18px auto 14px; width: min(236px, 100%); padding: 10px; background: #fff; box-shadow: 0 0 0 1px rgba(42, 35, 32, 0.1), 0 6px 14px rgba(60, 40, 25, 0.1); transform: rotate(1.2deg); }
.qr-modal-frame img { width: 100%; height: auto; }
.qr-modal-hint { font-family: var(--serif); font-weight: 600; font-size: 14px; }
.qr-modal-hint-sub { font-size: 12px; color: var(--ink-soft); }
.qr-modal-link { display: inline-block; margin-top: 14px; font-family: var(--hand); font-size: 15px; color: var(--rose); border-bottom: 1px dashed currentColor; }
.qr-modal-link:hover { color: var(--rose-deep); }

/* ── 进场：脚本确认支持 IntersectionObserver 且未开启减少动态效果时才给 <html> 加 .motion ── */
.motion [data-rv]:not(.is-in) { opacity: 0; }
[data-rv].is-in { animation: dlp-rise 0.85s var(--rv-spring, ease) var(--d, 0s) backwards; }
@keyframes dlp-rise { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }

@media (max-width: 1100px) and (min-width: 961px) {
  .dlp .dl-main { font-size: 15px; }
  .dl-t small { font-size: 11px; }
}

@media (max-width: 960px) {
  .dlp main { padding-top: 92px; }
  .dlp-desk { grid-template-columns: 1fr; gap: 44px; }
  .dlp-letter { padding: 52px 28px 36px; transform: none; }
  .dlp-to-phone { display: inline-flex; }
  .dlp-photo { flex-direction: row; justify-content: center; align-items: flex-end; gap: 0; }
  .dlp-pol { width: min(56%, 270px); }
  .dlp-notes { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
  .dlp-tips { grid-template-columns: 1fr; max-width: 560px; }
  .dlp-kraft { min-height: 0; }
}

@media (max-width: 560px) {
  .dlp-head { flex-wrap: wrap; gap: 4px 14px; }
  .dlp-head .stroke-rule { display: none; }
  .dlp-letter { padding: 46px 22px 30px; }
  .dlp-postmark { top: 16px; right: 14px; width: 62px; }
  .dlp-title { font-size: 22px; }
  .dlp-title span:last-child { white-space: normal; }
  .dlp-desktop { grid-template-columns: 1fr; gap: 10px; }
  .dlp-label { flex-wrap: wrap; gap: 2px 12px; }
  .dlp-points { margin-left: 0; flex-basis: 100%; }
  .dlp .dl-main { height: 60px; padding: 0 22px; }
  .dl-t { flex-direction: row; align-items: baseline; gap: 10px; }
  .dl-t small { margin-top: 0; }
  .dlp-photo { flex-direction: column; align-items: center; }
  .dlp-pol { width: min(62%, 240px); }
  .dlp-notes { grid-template-columns: 1fr; max-width: 320px; margin-inline: auto; }
  .dlp-kraft { padding: 50px 24px 28px 26px; }
  .bgm { right: 14px; bottom: 14px; }
  .bgm-label { display: none; }
  .bgm { padding: 6px; }
}
