/* 提货页：驿站取件单。基础变量和组件在 app.css */

/* ---------------------------------------------------------------- 顶栏 */
.mast { border-bottom: var(--rule); }
.mast-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.brand-mark { flex: none; }
.mast-nav { display: flex; gap: 18px; margin-left: auto; font-size: 14px; font-weight: 600; }
.mast-nav a { text-decoration: none; }
.mast-nav a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- 布局：取件单 + 须知栏 */
.pickup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas: "entry side" "result side" "history side";
  align-items: start;
  column-gap: 28px;
  padding-block: 32px 56px;
}
.entry { grid-area: entry; }
.waybill { grid-area: result; }
.history { grid-area: history; margin-top: 24px; }
.side { grid-area: side; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 20px; }

/* ---------------------------------------------------------------- 取件单 */
.entry .slip-head h1 { font-size: 20px; }
.slip-sub { color: var(--ink-2); font-size: 13px; }
.entry .barcode { margin-left: auto; }
.entry-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.entry-head label { font-size: 15px; font-weight: 700; }
.count { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.count b { font-family: var(--num); font-size: 20px; color: var(--ink); margin: 0 1px; }
.count .warn { color: var(--amber); font-weight: 600; }
.count .bad { color: var(--red); font-weight: 600; }
#codes {
  min-height: 210px;
  padding: 14px 16px;
  border: var(--rule);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: .04em;
  line-height: 1.75;
}
#codes::placeholder { font-family: var(--sans); letter-spacing: 0; font-size: 14px; }
.fmt-opt { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--field); border-radius: var(--r); cursor: pointer; font-size: 14px; }
.fmt-opt:hover { border-color: var(--ink-2); }
.fmt-opt input { margin-top: 3px; flex: none; }
.fmt-opt .hint { display: block; margin-top: 2px; }
.fmt-opt:has(input:checked) { border-style: solid; border-color: var(--green); background: var(--green-wash); }
.entry-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.entry-actions { display: flex; gap: 10px; margin-left: auto; }
#redeem-btn { min-width: 150px; font-size: 18px; letter-spacing: .2em; }
#redeem-btn .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgb(255 255 255 / .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
#redeem-btn.loading .spinner { display: inline-block; }
#redeem-btn.loading .label { letter-spacing: .04em; }
@keyframes spin { to { transform: rotate(360deg); } }
.kbd-hint { margin-top: 12px; font-size: 12px; color: var(--ink-2); }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--field); border-bottom-width: 2px; border-radius: 3px; background: var(--paper); }

/* ---------------------------------------------------------------- 面单（结果）：从取件单下方「打印」出来 */
.waybill { margin-top: 26px; }
.waybill .tear { margin: 0 12px 26px; }
.waybill > .slip { animation: print .42s var(--ease) both; }
@keyframes print {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-10px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}

.order { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; border-bottom: var(--rule); }
.order > * { padding: 16px 18px; }
.order-qty { display: flex; flex-direction: column; justify-content: center; border-right: var(--rule); min-width: 150px; }
.order-qty .n { font-family: var(--num); font-weight: 700; font-size: 64px; line-height: .9; color: var(--green); font-variant-numeric: tabular-nums; }
.order-qty .u { margin-top: 6px; font-weight: 700; }
.order-fields { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); align-content: center; gap: 10px 26px; justify-content: start; }
.order-fields .v { font-weight: 600; text-wrap: pretty; }
/* 订单号是这张面单的取件码：放到取件码尺度 */
.order-no { grid-column: 1 / -1; }
.order-no .code { font-family: var(--mono); font-weight: 700; font-size: clamp(18px, 5.2vw, 26px); letter-spacing: .04em; line-height: 1.25; word-break: break-all; }
.order-no .btn-inline { vertical-align: 5px; }
.order-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--green); }
.order-dl { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 8px; border-left: 1px dashed var(--field); min-width: 230px; }
.expire { font-size: 12px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
.expire.gone { color: var(--red); }

.order.none { grid-template-columns: 1fr; }
.order.none .order-msg { display: flex; gap: 10px; align-items: flex-start; }
.order.none .order-msg svg { flex: none; margin-top: 2px; color: var(--amber); }
.order.none b { display: block; font-size: 16px; }

.res-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--hair); }
.res-head h2 { font-size: 15px; }
.res-stats { display: flex; gap: 12px; font-size: 13px; color: var(--ink-2); margin-left: auto; }
.res-stats b { font-family: var(--num); font-size: 17px; color: var(--ink); }
.res-list { list-style: none; margin: 0; padding: 0; }
.res {
  display: grid;
  grid-template-columns: minmax(170px, auto) auto minmax(0, 1fr);
  align-items: center; gap: 6px 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--hair);
}
.res:last-child { border-bottom: 0; }
.res-code { font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: .03em; word-break: break-all; }
.res-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); }
.res-meta b { color: var(--ink); }
.res-dl { display: inline-flex; white-space: nowrap; }
.msg-bad { color: var(--red); font-weight: 600; }
.msg-warn { color: var(--amber); font-weight: 600; }
.history .res-list { border-bottom: 1px solid var(--hair); }
.history .note { padding: 10px 18px 14px; font-size: 12px; color: var(--ink-2); }
.history .slip-head h2 { font-size: 15px; flex: 1; }

/* ---------------------------------------------------------------- 须知栏 */
.notes h2, .support h2 { font-size: 15px; padding-bottom: 8px; border-bottom: var(--rule); margin-bottom: 12px; }
.notes ol { margin: 0; padding: 0; list-style: none; counter-reset: tip; }
.notes li { position: relative; padding: 0 0 12px 30px; font-size: 13px; line-height: 1.6; color: var(--ink-2); counter-increment: tip; }
.notes li b { color: var(--ink); }
.notes li::before {
  content: counter(tip);
  position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 1.5px solid var(--ink); border-radius: 50%;
  font-family: var(--num); font-weight: 700; font-size: 13px; color: var(--ink);
}
.support { padding: 16px; border: var(--rule); border-radius: var(--r); }
.support h2 { border-bottom-width: 1px; border-bottom-color: var(--hair); }
.qq { font-size: 32px; font-weight: 700; line-height: 1.1; margin: 2px 0 12px; }
.support-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.support-actions .btn { flex: 1; }
.support-hint { margin-top: 10px; font-size: 12px; color: var(--ink-2); }

/* ---------------------------------------------------------------- 工具说明：中线左右对照 */
.tools { border-top: var(--rule); padding-block: 48px 56px; scroll-margin-top: 0; }
.tools-head { max-width: 760px; margin-bottom: 28px; }
.tools-head h2 { font-size: 26px; margin-bottom: 8px; }
.tools-head p { color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.pair {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: var(--rule); border-radius: var(--r);
}
.tool { display: flex; flex-direction: column; min-width: 0; padding: 22px 24px 24px; }
.tool + .tool { border-left: var(--rule); }
/* 只剩一个工具：独占整行，没有中线 */
.pair.single { grid-template-columns: minmax(0, 1fr); }
.pair.single .tool { border-left: 0; }
.convert-note { margin-top: 20px; }
.tool-top { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--hair); }
.tool-top h3 { font-family: var(--num); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: .01em; }
.tool-what { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.tool .fl { margin-bottom: 4px; }
.tool-who { color: var(--ink-2); margin-bottom: 16px; }
.steps { margin: 2px 0 20px; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 0 0 12px 34px; counter-increment: step; line-height: 1.7; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; border-radius: 2px;
  font-family: var(--num); font-weight: 700; font-size: 15px;
}
.dl-link { align-self: flex-start; margin-top: auto; }
.dl-url { margin-top: 8px; font-size: 12px; color: var(--ink-2); word-break: break-all; }

.compare { margin-top: 36px; }
.compare h3 { font-size: 18px; }
.compare table { min-width: 560px; }
.compare th[scope=row] { width: 120px; border-bottom: 1px solid var(--hair); color: var(--ink); font-size: 13px; }
.compare thead th { font-family: var(--num); font-size: 17px; color: var(--ink); }
.compare td { width: 40%; }
.compare-note { margin-top: 12px; font-size: 13px; color: var(--ink-2); }

.foot { border-top: var(--rule); }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 18px 28px; font-size: 12px; color: var(--ink-2); }

/* ---------------------------------------------------------------- 窄屏 */
@media (max-width: 900px) {
  .pickup { grid-template-columns: 1fr; grid-template-areas: "entry" "result" "history" "side"; padding-top: 20px; }
  .side { position: static; margin-top: 28px; }
  .order { grid-template-columns: auto minmax(0, 1fr); }
  .order-dl { grid-column: 1 / -1; border-left: 0; border-top: 1px dashed var(--field); }
}
@media (max-width: 640px) {
  .mast-in { min-height: 52px; }
  .brand { font-size: 16px; }
  .mast-nav { gap: 12px; font-size: 13px; }
  .entry .slip-head h1 { flex: 1; }
  .entry .barcode { width: 72px; height: 20px; order: 1; }
  .entry .slip-sub { order: 2; }
  .slip-sub { flex-basis: 100%; }
  #codes { min-height: 170px; font-size: 15px; padding: 12px; }
  .entry-foot { align-items: stretch; }
  .entry-actions { width: 100%; margin-left: 0; }
  .entry-actions .btn { flex: 1; }
  #redeem-btn { flex: 2; }
  .kbd-hint { display: none; }
  .order { grid-template-columns: 1fr; }
  .order-qty { flex-direction: row; align-items: baseline; gap: 10px; border-right: 0; border-bottom: 1px dashed var(--field); }
  .order-qty .n { font-size: 52px; }
  .order-fields { grid-template-columns: 1fr 1fr; }
  .res { grid-template-columns: 1fr auto; padding: 10px 14px; }
  .res-meta { grid-column: 1 / -1; }
  .res-head { padding: 10px 14px; }
  .res-stats { margin-left: 0; width: 100%; }
  .tools { padding-block: 36px 44px; }
  .tools-head h2 { font-size: 22px; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .tool { padding: 18px 16px 20px; }
  .tool + .tool { border-left: 0; border-top: var(--rule); }
  .dl-link { align-self: stretch; }
  .compare table { min-width: 0; table-layout: fixed; }
  .compare th[scope=row] { width: 76px; padding-inline: 6px; }
  .compare th, .compare td { padding-inline: 6px; font-size: 13px; }
  .compare thead th { font-size: 15px; }
  .compare td { width: auto; }
}
