/* V5: Page 04 is a two-step purchase dossier, followed by a viewport-safe decision. */
:root {
  --v5-gold:#d8b979;
  --v5-ink:#12343a;
  --v5-paper:#f1ecdf;
  --v5-red:#a64d45;
  --v5-enter:cubic-bezier(.2,.78,.2,1);
}

.purchase-reader-screen,.purchase-choice-screen {
  height:100%; min-height:0!important;
  padding:104px 14px max(28px,env(safe-area-inset-bottom));
  color:#fff; overflow:hidden;
}
.purchase-reader-screen {
  display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; gap:9px;
}
.purchase-reader-screen::after,.purchase-choice-screen::after {
  background:linear-gradient(180deg,rgba(3,20,24,.28),rgba(3,20,24,.72) 48%,rgba(3,20,24,.96));
}
.purchase-stage-head { position:relative; z-index:4; }

.purchase-lead {
  position:relative; z-index:3; padding:4px 2px 2px;
  animation:v5FadeUp .48s var(--v5-enter) both;
}
.purchase-kicker { display:block; color:var(--v5-gold); font:700 9px/1.2 "Times New Roman",serif; letter-spacing:.14em; }
.purchase-amount { display:flex; align-items:end; gap:7px; margin:4px 0 3px; }
.purchase-amount small { margin-bottom:6px; color:rgba(255,255,255,.68); font-size:11px; }
.purchase-amount b { color:#fff7e8; font:700 30px/1 "Times New Roman",serif; letter-spacing:-.03em; }
.purchase-amount i { margin-bottom:5px; padding:3px 6px; border:1px solid rgba(216,185,121,.48); border-radius:3px; color:#ffe7b5; background:rgba(216,185,121,.13); font-size:9px; font-style:normal; font-weight:700; }
.purchase-lead p { margin:0; color:rgba(255,255,255,.76); font-size:12px; line-height:1.45; }
.purchase-lead mark { padding:0 2px; color:#fff; background:linear-gradient(transparent 52%,rgba(166,77,69,.78) 52%); }

.purchase-manifest {
  position:relative; z-index:3; min-height:0; max-height:360px; padding:9px;
  display:grid; grid-template-rows:auto minmax(0,1fr) minmax(0,1fr) auto; gap:6px;
  border:1px solid rgba(255,255,255,.28); border-radius:16px;
  color:var(--v5-ink); background:rgba(241,236,223,.97);
  box-shadow:0 18px 44px rgba(0,0,0,.25);
  animation:v5ManifestIn .56s .08s var(--v5-enter) both;
}
.manifest-head { display:flex; align-items:center; justify-content:space-between; padding:0 3px 2px; }
.manifest-head span { font-size:12px; font-weight:800; }
.manifest-head small { color:#927a54; font:700 8px/1 "Times New Roman",serif; letter-spacing:.13em; }
.product.product-real {
  position:relative; min-height:0; padding:5px 9px 5px 70px;
  grid-template-columns:minmax(0,1fr) auto; gap:7px; overflow:hidden;
  border-color:rgba(17,52,58,.12); border-radius:11px; box-shadow:none;
}
.product-real img {
  position:absolute; left:8px; bottom:-5px; width:61px; height:67px; object-fit:contain;
  filter:drop-shadow(0 7px 7px rgba(47,37,24,.18));
  transform:translateY(6px) scale(.94); opacity:0;
  animation:v5ProductIn .5s .22s var(--v5-enter) forwards;
}
.product-real:nth-of-type(3) img { animation-delay:.29s; }
.product-real .product-index { position:absolute; left:5px; top:4px; margin:0; color:#9d8661; font:700 8px/1 "Times New Roman",serif; }
.product-real > div { min-width:0; align-self:center; }
.product-real b { display:block; font-size:14px; }
.product-real small { display:block; margin-top:2px; color:#6f7e80; font-size:10px; }
.product-real .product-price { align-self:center; white-space:nowrap; font:700 13px/1 "Times New Roman",serif; }
.manifest-total { display:flex; justify-content:space-between; align-items:center; padding:5px 4px 1px; border-top:1px dashed rgba(17,52,58,.2); }
.manifest-total span { color:#718083; font-size:10px; }
.manifest-total b { font:700 14px/1 "Times New Roman",serif; }

.purchase-reader-footer {
  position:relative; z-index:4; min-height:65px; padding:8px 8px 8px 13px;
  display:grid; grid-template-columns:minmax(0,1fr) 108px; align-items:center; gap:9px;
  border:1px solid rgba(255,255,255,.3); border-radius:12px;
  background:rgba(7,31,37,.91); box-shadow:0 10px 30px rgba(0,0,0,.23); backdrop-filter:blur(14px);
}
.purchase-reader-footer small { display:block; margin-bottom:3px; color:var(--v5-gold); font-size:9px; }
.purchase-reader-footer b { display:block; font-size:12px; line-height:1.35; }
.purchase-next {
  width:108px; height:50px; padding:0 9px 0 12px; display:flex; align-items:center; justify-content:space-between; gap:6px;
  border:0; border-radius:9px; color:#17383c; background:var(--v5-gold);
  box-shadow:0 8px 20px rgba(0,0,0,.18); cursor:pointer; font-size:13px; font-weight:800;
  transition:filter .15s ease,box-shadow .18s ease,transform .15s ease;
}
.purchase-next svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.purchase-next:active { filter:brightness(.9); transform:scale(.96); }
.purchase-next:focus-visible { outline:3px solid #fff; outline-offset:2px; }

.purchase-choice-screen { display:flex; flex-direction:column; gap:9px; }
.purchase-judgement { position:relative; z-index:3; padding:7px 2px 2px; animation:v5FadeUp .48s var(--v5-enter) both; }
.purchase-judgement h2 { margin:5px 0 0; font-family:"STSong","Songti SC",serif; font-size:clamp(27px,7.5vw,33px); line-height:1.12; letter-spacing:-.025em; }
.purchase-judgement h2 em { position:relative; color:#fff; font-style:normal; }
.purchase-judgement h2 em::after { content:""; position:absolute; left:0; right:0; bottom:-2px; height:6px; transform:skewX(-16deg); background:rgba(216,185,121,.55); z-index:-1; }
.purchase-judgement p { margin:7px 0 0; color:rgba(255,255,255,.7); font-size:12px; line-height:1.48; }
.custody-chain {
  position:relative; z-index:3; min-height:50px; padding:7px 9px; display:flex; align-items:center; gap:5px;
  border:1px solid rgba(255,255,255,.22); border-radius:10px; background:rgba(5,28,33,.62); font-size:9px;
}
.custody-chain span,.custody-chain b { flex:0 1 auto; line-height:1.25; text-align:center; }
.custody-chain b { color:#ffe2a5; }
.custody-chain i { flex:1; min-width:12px; height:1px; position:relative; background:rgba(255,255,255,.33); }
.custody-chain i::after { content:""; position:absolute; right:-1px; top:-2px; width:5px; height:5px; transform:rotate(45deg); border-top:1px solid rgba(255,255,255,.6); border-right:1px solid rgba(255,255,255,.6); }
.purchase-choice-panel {
  position:relative; z-index:4; margin-top:auto; padding:10px;
  border:1px solid rgba(255,255,255,.28); border-radius:15px;
  color:var(--v5-ink); background:rgba(241,236,223,.98); box-shadow:0 18px 44px rgba(0,0,0,.25);
}
.purchase-choice-panel .choice-grid { gap:8px; }
.purchase-choice-panel .choice { min-height:62px; padding:9px 10px 9px 13px; border-radius:11px; }
.purchase-choice-panel .choice strong { font-size:14px; }
.purchase-choice-panel .choice small { margin-top:2px; font-size:10px; }
.purchase-choice-panel .choice-arrow { flex:0 0 32px; width:32px; height:32px; border-radius:8px; }

/* Choice feedback: pointer hover complements, but never replaces, tap/click. */
.choice { position:relative; overflow:hidden; touch-action:manipulation; transition:border-color .18s ease,background-color .18s ease,box-shadow .18s ease,transform .16s ease; }
.choice::before { content:""; position:absolute; inset:0; pointer-events:none; background:linear-gradient(100deg,transparent 18%,rgba(216,185,121,.16) 48%,transparent 72%); transform:translateX(-115%); transition:transform .42s var(--v5-enter); }
.choice .choice-copy,.choice .choice-arrow { position:relative; z-index:1; }
.choice:active { transform:scale(.985); background:#fbf6ed; border-color:rgba(166,77,69,.48); box-shadow:0 3px 10px rgba(35,51,54,.12); }
.choice:focus-visible { outline:3px solid var(--v5-gold); outline-offset:2px; border-color:#7c6338; }
@media (hover:hover) and (pointer:fine) {
  .choice:hover { transform:translateY(-2px); border-color:rgba(166,77,69,.5); background:#fffdf8; box-shadow:0 10px 24px rgba(16,48,53,.14); }
  .choice:hover::before { transform:translateX(115%); }
  .choice:hover .choice-arrow { color:#fff; background:var(--v5-red); transform:translateX(2px); }
  .purchase-next:hover { filter:brightness(1.06); box-shadow:0 10px 24px rgba(216,185,121,.23); transform:translateY(-1px); }
}

@keyframes v5FadeUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }
@keyframes v5ManifestIn { from{opacity:0;transform:translateY(15px) rotateX(4deg)} to{opacity:1;transform:none} }
@keyframes v5ProductIn { to{opacity:1;transform:none} }

@media (max-height:740px) {
  .purchase-reader-screen,.purchase-choice-screen { padding-top:96px; padding-bottom:max(24px,env(safe-area-inset-bottom)); gap:7px; }
  .purchase-lead { padding-top:1px; }
  .purchase-amount { margin-top:2px; }
  .purchase-amount b { font-size:27px; }
  .purchase-lead p { font-size:11px; line-height:1.4; }
  .purchase-manifest { padding:7px; gap:4px; }
  .product.product-real { padding-top:3px; padding-bottom:3px; }
  .product-real img { width:58px; height:60px; }
  .purchase-reader-footer { min-height:59px; grid-template-columns:minmax(0,1fr) 100px; }
  .purchase-reader-footer b { font-size:11px; }
  .purchase-next { width:100px; height:45px; font-size:12px; }
  .purchase-judgement { padding-top:2px; }
  .purchase-judgement h2 { font-size:26px; }
  .purchase-judgement p { margin-top:5px; font-size:11px; line-height:1.4; }
  .custody-chain { min-height:43px; }
  .purchase-choice-panel .choice { min-height:57px; }
}

@media (max-width:370px) {
  .purchase-reader-screen,.purchase-choice-screen { padding-left:10px; padding-right:10px; }
  .product.product-real { padding-left:62px; }
  .product-real img { left:8px; width:48px; }
  .purchase-reader-footer b { font-size:10px; }
  .custody-chain { font-size:8px; }
}

@media (prefers-reduced-motion:reduce) {
  .purchase-lead,.purchase-manifest,.product-real img { animation:none!important; opacity:1; transform:none; }
  .choice,.choice::before,.choice .choice-arrow,.purchase-next { transition:none!important; }
  .choice:hover,.purchase-next:hover { transform:none!important; }
}
