/* 小创解梦：一期孔版小志。三种专色油墨在再生纸上叠印、错版、缺墨。 */

@font-face {
  font-family: "QK UI";
  src: url("/fonts/qingke-ui.woff2?v=riso3") format("woff2");
  font-display: swap;
}

:root {
  --paper: #f4f0e8;
  --paper-shade: #e9e3d6;
  --blue: #3d5588;      /* 联邦蓝：正文油墨 */
  --blue-deep: #2f4473;
  --pink: #ff48b0;      /* 荧光粉：色块 */
  --pink-ink: #e8339a;  /* 荧光粉压字：大字对比 ≥3:1 */
  --pink-deep: #c81d7f; /* 小字用的粉：对比 ≥4.5:1 */
  --pink-tint: #ffd9ec;
  --yellow: #ffe800;    /* 向日葵黄 */
  --display: "QK Report", "QK UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --body: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --gutter: clamp(18px, 5vw, 48px);
  --measure: 34em;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--blue) var(--paper-shade); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper) url("/img/paper.png") repeat;
  background-blend-mode: multiply;
  color: var(--blue);
  font: 16px/1.85 var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--yellow); color: var(--blue-deep); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--paper-shade); }
::-webkit-scrollbar-thumb { background: var(--blue); border-radius: 8px; }
a { color: inherit; text-underline-offset: 0.25em; }
:focus-visible { outline: 2px solid var(--pink-ink); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }

/* 缺墨颗粒：所有油墨元素共用一张 alpha 遮罩 */
.cut, .glyph, .loading-inks i {
  -webkit-mask-image: url("/img/speckle.png");
  mask-image: url("/img/speckle.png");
  -webkit-mask-size: 240px 240px;
  mask-size: 240px 240px;
}
/* 字和大色场用轻一档的缺墨：同一张遮罩，再并上一层 60% 实底，孔只掉一半墨 */
.tl-ink, .tl-ghost, .dual-ink, .dual-ghost, .stamp, .field::before {
  -webkit-mask-image: url("/img/speckle.png"), linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.62));
  mask-image: url("/img/speckle.png"), linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.62));
  -webkit-mask-size: 240px 240px, 100% 100%;
  mask-size: 240px 240px, 100% 100%;
  -webkit-mask-composite: source-over;
  mask-composite: add;
}

/* ---------- 封面 ---------- */

.cover {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 22px;
  overflow: hidden;
  isolation: isolate;
  cursor: default;
}
.cover-short { min-height: 88vh; min-height: 88svh; }

.masthead {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue);
}
.mast-name { font: 26px/1 var(--display); color: var(--blue); }
.mast-date { justify-self: end; font: 600 13px/1 var(--body); letter-spacing: 0.08em; }
.legend { grid-column: 1 / -1; display: flex; gap: 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.lg-zg::before { background: var(--yellow); box-shadow: inset 0 0 0 1px rgba(61, 85, 136, 0.35); }
.lg-fr::before { background: var(--pink); }
.lg-jg::before { background: var(--blue); }

.cover-art { position: absolute; inset: 70px 0 6% 0; z-index: 0; pointer-events: none; }
.cut { position: absolute; display: block; aspect-ratio: 1; mix-blend-mode: multiply; transform: rotate(var(--rot, 0deg)); }
.ink-yellow { --ink: var(--yellow); }
.ink-pink { --ink: var(--pink); }
.ink-blue { --ink: var(--blue); }
.ink-paper { --ink: var(--paper); }
.cut-disc { border-radius: 50%; background: var(--ink); }
.cut-slab, .cut-slab-b { aspect-ratio: 2.2; background: var(--ink); }
.cut-slab { clip-path: polygon(0 18%, 100% 0, 92% 100%, 4% 86%); }
.cut-slab-b { clip-path: polygon(6% 0, 100% 14%, 100% 92%, 0 100%); }
.cut-half { border-radius: 999px 999px 0 0; aspect-ratio: 2; background: var(--ink); }
.cut-ring { border-radius: 50%; border: clamp(10px, 4vw, 26px) solid var(--ink); }
.cut-tri { clip-path: polygon(50% 0, 100% 100%, 0 100%); background: var(--ink); }
.cut-screen {
  background: radial-gradient(circle, var(--ink) 34%, transparent 37%) 0 0 / 9px 9px;
}

.cover-body { position: relative; z-index: 2; margin-top: auto; padding-top: 22vh; }
.cover-title {
  --tsize: 72px;
  display: block;
  font: normal var(--tsize)/1.02 var(--display);
  letter-spacing: 0;
}
.tline { position: relative; display: block; white-space: nowrap; }
.tl-ink, .tl-ghost { display: inline-block; color: var(--ink); mix-blend-mode: multiply; }
.tl-ink { position: relative; }
.tl-ink.ink-pink { color: var(--pink-ink); }
/* 第二遍墨：同一行字用另一种油墨实地印一遍，套偏一点，叠在一起的地方混成紫 */
.tl-ghost {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.22;
  transform: translate(calc(var(--tsize) * -0.035), calc(var(--tsize) * 0.03));
}
.cover-sub {
  margin-top: 12px;
  max-width: 22em;
  font-size: clamp(16px, 4.3vw, 20px);
  line-height: 1.65;
  font-weight: 600;
}
.cover-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 14px; }
.moods { display: flex; flex-wrap: wrap; gap: 8px; }
.moods li {
  position: relative;
  padding: 4px 13px;
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.moods li::after { /* 第二遍粉墨套偏 */
  content: "";
  position: absolute;
  inset: -1.5px;
  border: 1.5px solid var(--pink);
  border-radius: inherit;
  transform: translate(3px, 2px);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.stamp {
  flex: none;
  display: grid;
  place-items: center;
  align-content: center;
  width: 84px;
  aspect-ratio: 1;
  margin-right: 2px;
  border-radius: 50%;
  border: 3px solid var(--pink-ink);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5.5px var(--pink-ink);
  color: var(--pink-ink);
  transform: rotate(-11deg);
  mix-blend-mode: multiply;
}
.stamp-k { font: 700 11px/1 var(--body); letter-spacing: 0.3em; margin-right: -0.3em; color: var(--pink-deep); }
.stamp-v { font: 34px/1.05 var(--display); }

.cue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.cue svg { width: 18px; height: 18px; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* ---------- 正文段落 ---------- */

.sec { padding: 72px var(--gutter) 8px; max-width: calc(var(--measure) + 2 * var(--gutter) + 120px); margin: 0 auto; }
.ink-head {
  margin-bottom: 22px;
  font: normal clamp(44px, 12vw, 72px)/1.05 var(--display);
}
/* 双墨大字：底下一层另一种墨套偏，上面主墨，两层都 multiply，叠处出第三色 */
.dual { position: relative; display: block; width: fit-content; }
.dual-ink, .dual-ghost { display: block; color: var(--ink); mix-blend-mode: multiply; }
.dual-ink.ink-pink { color: var(--pink-ink); }
.dual-ink { position: relative; }
.dual-ghost { position: absolute; left: 0; top: 0; opacity: 0.22; transform: translate(-0.04em, 0.032em); }
.dual-ink.ink-paper { mix-blend-mode: normal; }

.retell { max-width: var(--measure); font-size: 18px; line-height: 1.95; font-weight: 500; }
.origin { margin-top: 20px; max-width: var(--measure); }
.origin summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.2s ease;
}
.origin summary::-webkit-details-marker { display: none; }
.origin summary:hover { background: var(--yellow); }
.origin summary svg { width: 16px; height: 16px; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.origin[open] summary svg { transform: rotate(45deg); }
.origin p { margin-top: 14px; padding: 14px 16px; background: rgba(255, 232, 0, 0.35); border-radius: 12px; white-space: pre-wrap; font-size: 15px; }

/* 意象：编辑式列表，不是卡片墙 */
.symbols { border-top: 2px solid var(--blue); }
.symbol { padding: 22px 0 24px; border-bottom: 1.5px solid rgba(61, 85, 136, 0.35); }
.symbol-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.symbol-name { font: normal clamp(28px, 7.5vw, 40px)/1.15 var(--display); color: var(--blue); }
.glyph { flex: none; display: block; width: 34px; aspect-ratio: 1; mix-blend-mode: multiply; transform: rotate(var(--rot, 0deg)); }
.glyph-disc { border-radius: 50%; background: var(--ink); }
.glyph-half { aspect-ratio: 2; border-radius: 99px 99px 0 0; background: var(--ink); }
.glyph-tri { clip-path: polygon(50% 0, 100% 100%, 0 100%); background: var(--ink); }
.glyph-ring { border-radius: 50%; border: 7px solid var(--ink); }
.glyph-slab { aspect-ratio: 1.6; clip-path: polygon(0 16%, 100% 0, 92% 100%, 4% 86%); background: var(--ink); }
.reads { display: grid; gap: 12px; max-width: var(--measure); }
.read dt { margin-bottom: 2px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.read dt::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.read-zg dt::before { background: var(--yellow); box-shadow: inset 0 0 0 1px rgba(61, 85, 136, 0.4); }
.read-fr dt::before { background: var(--pink); }
.read-jg dt::before { background: var(--blue); }
.read dd { font-size: 15.5px; line-height: 1.8; }
.read dd, .retell, .spread-text, .questions li, .coupon-v, .cover-sub { text-wrap: pretty; }

/* 三种读法：整幅色场，一人一种油墨 */
.spread { position: relative; margin-top: 72px; padding: 64px var(--gutter) 72px; overflow: hidden; isolation: isolate; }
.field::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--field); }
.spread + .spread { margin-top: 0; }
.spread-in { position: relative; z-index: 0; max-width: calc(var(--measure) + 120px); margin: 0 auto; }
.spread-name { font: normal clamp(68px, 20vw, 132px)/0.98 var(--display); margin-left: -0.04em; }
.spread-role { margin: 14px 0 22px; font-size: 15px; font-weight: 700; letter-spacing: 0.06em; }
.spread-text { max-width: var(--measure); font-size: 17px; line-height: 2; font-weight: 500; }

.spread-zg { --field: var(--yellow); color: var(--blue-deep); }
.spread-zg .dual-ink { color: var(--blue-deep); }

/* 弗洛伊德：粉色网屏铺满整幅，标题那一带网点加密 */
.spread-fr { --field: var(--pink-tint); color: var(--blue-deep); }
.spread-fr::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(64px + clamp(68px, 20vw, 132px) * 1.1);
  z-index: -1;
  background: radial-gradient(circle, var(--pink) 30%, transparent 34%) 0 0 / 8px 8px;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
  opacity: 0.55;
}

.spread-jg { --field: var(--blue); color: var(--paper); }
/* 荣格正文底下垫一块羽化的实底蓝：纸色缺墨点不落在纸色字后面 */
.spread-jg .spread-text { position: relative; }
.spread-jg .spread-text::before {
  content: "";
  position: absolute;
  /* 横向铺满整幅（色场 overflow 会裁掉多出的部分），只在上下羽化：颗粒在正文上下渐隐，不成一块面板 */
  inset: -28px -100vw;
  z-index: -1;
  background: var(--blue);
  -webkit-mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 28px), transparent);
}
.spread-jg ::selection { background: var(--pink); color: var(--paper); }

/* 醒来想一想 */
.questions { counter-reset: q; max-width: var(--measure); }
.questions li {
  counter-increment: q;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1.5px solid rgba(61, 85, 136, 0.35);
  font-size: 18px;
  line-height: 1.7;
  font-weight: 600;
}
.questions li::before {
  content: counter(q);
  font: normal 46px/0.9 var(--display);
  color: transparent;
  -webkit-text-stroke: 1.8px var(--pink-ink);
}

/* 今天可以：一张能剪下来的券 */
.sec-coupon { padding-top: 56px; }
.coupon {
  position: relative;
  max-width: 30em;
  padding: 26px 26px 26px 30px;
  background: var(--yellow);
  border-radius: 6px;
  outline: 2px dashed var(--blue);
  outline-offset: 7px;
}
.coupon::before, .coupon::after { /* 两侧的打孔缺口 */
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--paper);
}
.coupon::before { left: -11px; }
.coupon::after { right: -11px; }
.coupon-cut { position: absolute; top: -21px; left: 18px; width: 22px; height: 22px; color: var(--blue); background: var(--paper); padding: 2px; }
.coupon-k { font: normal 30px/1.1 var(--display); color: var(--blue-deep); }
.coupon-v { margin-top: 10px; font-size: 18px; line-height: 1.75; font-weight: 600; color: var(--blue-deep); }

/* 收尾与版权页 */
.end { max-width: calc(var(--measure) + 2 * var(--gutter) + 120px); margin: 0 auto; padding: 88px var(--gutter) max(48px, env(safe-area-inset-bottom)); }
.closing {
  font: normal clamp(30px, 8.6vw, 52px)/1.3 var(--display);
  color: var(--pink-ink);
  text-shadow: -0.04em 0.03em 0 rgba(61, 85, 136, 0.5);
  text-wrap: balance;
}
.colophon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  column-gap: 32px;
  margin-top: 56px;
  border-top: 2px solid var(--blue);
}
.colophon div { padding: 12px 0; border-bottom: 1px solid rgba(61, 85, 136, 0.3); }
.colophon dt { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; opacity: 0.75; }
.colophon dd { font-size: 14px; font-weight: 600; }
.fine { margin-top: 26px; font-size: 13px; line-height: 1.8; }
.phrase { display: inline-block; }

/* 首页 */
.is-home .home-how { padding-top: 24px; }
.is-home .questions li { font-weight: 500; }

/* 载入：三遍墨条 */
.state { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; font-weight: 700; letter-spacing: 0.3em; }
.loading-inks { display: flex; gap: 8px; }
.loading-inks i { width: 14px; height: 44px; border-radius: 3px; animation: ink-bob 1.1s cubic-bezier(0.5, 0, 0.5, 1) infinite; mix-blend-mode: multiply; }
.loading-inks i:nth-child(1) { background: var(--yellow); }
.loading-inks i:nth-child(2) { background: var(--pink); animation-delay: 0.12s; }
.loading-inks i:nth-child(3) { background: var(--blue); animation-delay: 0.24s; }
@keyframes ink-bob { 50% { transform: scaleY(0.45); } }

/* ---------- 招牌动效：三遍上墨 ----------
   默认就是印好的样子；只有 .printing 期间才从「还没上这遍墨」走到位，
   三种墨依次过滚筒，最后带着一点错版落定。 */
.printing .pass-1 { animation: lay 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
.printing .pass-2 { animation: lay 0.9s 0.28s cubic-bezier(0.16, 1, 0.3, 1) both; }
.printing .pass-3 { animation: lay 0.9s 0.56s cubic-bezier(0.16, 1, 0.3, 1) both; }
.printing .tline .tl-ghost { animation: register 1.4s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes lay {
  from { clip-path: inset(0 0 100% 0); translate: 0 -10px; }
  to { clip-path: inset(0 0 0 0); translate: 0 0; }
}
@keyframes register {
  from { translate: calc(var(--tsize) * 0.09) calc(var(--tsize) * -0.06); opacity: 0.2; }
}
.cut.pass-1, .cut.pass-2, .cut.pass-3 { will-change: clip-path; }

/* 分享卡：封面占满一屏减去页脚，页脚是二维码和链接 */
.is-card { --foot: 150px; }
.is-card .cover { min-height: calc(100vh - var(--foot)); padding-bottom: 14px; }
.card-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--foot);
  margin: 0 var(--gutter);
  border-top: 2px solid var(--blue);
}
.card-qr { flex: none; width: 112px; height: 112px; }
.card-qr svg { display: block; width: 100%; height: 100%; }
.qr-bg { fill: var(--paper); }
.qr-ink { fill: var(--blue-deep); }
.card-k { font: 22px/1.2 var(--display); color: var(--pink-ink); }
.card-v { margin-top: 6px; font-size: 13px; line-height: 1.5; font-weight: 600; }
.card-url { margin-top: 6px; font-size: 12px; letter-spacing: 0.02em; opacity: 0.8; }

@media (min-width: 760px) {
  .cover { padding-top: 22px; }
  .cover { padding-bottom: 48px; }
  .cover-art { inset: 72px 0 4% 0; }
  .cover-body { padding-top: 26vh; max-width: min(860px, 64vw); }
  .cover-meta { justify-content: flex-start; gap: 40px; }
  .stamp { width: 116px; }
  .stamp-v { font-size: 42px; }
  .symbols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .questions li { grid-template-columns: 72px 1fr; }
  .questions li::before { font-size: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cue svg, .loading-inks i { animation: none; }
}
