/* ============================================================
   京粉转链铺 —— 「老账房 × 电子票据」
   暖墨底 / 宋体招牌 / 印章红 / 米白票据 / 锯齿裁切边
   零外部资源：字体走系统栈，纹理由 CSS 与内联 SVG 生成
   ============================================================ */

:root {
  --ink: #16130e;            /* 暖墨黑：页面底色 */
  --ink-soft: #221d15;
  --paper: #f6efdd;          /* 米白票据 */
  --paper-dim: #eee4cc;
  --paper-line: rgba(58, 48, 34, .28);
  --ink-text: #2e2820;       /* 票据上的墨字 */
  --red: #d8261c;            /* 印章红（京东红调沉） */
  --red-deep: #a5170f;
  --gold: #c9a35f;
  --gold-dim: rgba(201, 163, 95, .55);
  --cream: #f1e8d2;          /* 深底上的浅字 */
  --muted: #97907e;

  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", STSong, SimSun, Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Heiti SC", sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, Menlo, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* 触屏：取消双击缩放延迟与系统高亮色，反馈交给自绘 :active */
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--sans);
  color: var(--cream);
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(216, 38, 28, .16), transparent 62%),
    radial-gradient(820px 520px at -12% 34%, rgba(201, 163, 95, .09), transparent 58%),
    var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 账本网格 */
body::before {
  content: "";
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg,   transparent 0 35px, rgba(246, 239, 221, .034) 35px 36px),
    repeating-linear-gradient(90deg,  transparent 0 35px, rgba(246, 239, 221, .034) 35px 36px);
  z-index: 0;
}

/* 纸张噪点 */
body::after {
  content: "";
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.92 0 0 0 0 0.85 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

/* 顶部朱砂细带 */
.topline {
  position: fixed; top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--red-deep), var(--red) 38%, var(--gold) 120%);
  z-index: 10;
}

/* 竖排旁批 */
.side-note {
  position: fixed;
  top: 108px; right: max(18px, calc(50vw - 470px));
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .58em;
  color: var(--gold-dim);
  border-right: 1px solid rgba(201, 163, 95, .3);
  padding-right: 10px;
  z-index: 1;
  pointer-events: none;
  animation: fade-in 1.2s .5s both;
}

/* 背景大字「粉」 */
.bg-glyph {
  position: fixed;
  left: -60px; bottom: -110px;
  font-family: var(--serif);
  font-size: 460px;
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(246, 239, 221, .055);
  user-select: none;
  pointer-events: none;
  z-index: 0;
  animation: fade-in 1.6s .3s both;
}

.page {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 84px 20px 72px;
  /* 刘海屏横持时避开安全区 */
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* ---------------------------------------------------------- 招牌 */

.hero { position: relative; margin-bottom: 44px; }

.seal-logo {
  position: absolute;
  top: -6px; right: 2px;
  width: 64px; height: 64px;
  border: 2.5px solid var(--red);
  border-radius: 10px;
  color: var(--red);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  transform: rotate(8deg);
  box-shadow: inset 0 0 0 1.5px rgba(216, 38, 28, .35), 0 0 22px rgba(216, 38, 28, .18);
  animation: stamp-in .55s .9s cubic-bezier(.2, 1.6, .4, 1) both;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .32em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 18px;
  animation: fade-up .7s .1s both;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 72px; /* clamp 的 iOS 13 降级值 */
  font-size: clamp(52px, 11vw, 88px);
  line-height: 1.04;
  letter-spacing: .06em;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}

.hero-title span {
  display: inline-block;
  animation: char-drop .6s cubic-bezier(.22, 1.4, .36, 1) both;
}
.hero-title span:nth-child(1) { animation-delay: .12s; }
.hero-title span:nth-child(2) { animation-delay: .22s; }
.hero-title span:nth-child(3) { animation-delay: .32s; }
.hero-title span:nth-child(4) { animation-delay: .42s; }
.hero-title span:nth-child(5) { animation-delay: .56s; }

.hero-title-shop {
  color: var(--red);
  position: relative;
  margin-left: .1em;
  text-shadow: 0 0 34px rgba(216, 38, 28, .5);
}

.hero-sub {
  margin-top: 20px;
  max-width: 34em;
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--muted);
  animation: fade-up .7s .55s both;
}
.hero-sub b { color: var(--cream); font-weight: 600; }

/* ---------------------------------------------------------- 提示条 */

.notice {
  padding: 13px 16px;
  font-size: 13.5px;
  line-height: 1.8;
  margin-bottom: 22px;
  border-radius: 3px;
}
.notice code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 6px;
  background: rgba(246, 239, 221, .1);
  border-radius: 3px;
}
.notice--warn {
  color: #e8d9ae;
  background: rgba(201, 163, 95, .08);
  border: 1px solid rgba(201, 163, 95, .38);
  border-left: 4px solid var(--gold);
}
.notice--error {
  color: #f4c1bc;
  background: rgba(216, 38, 28, .08);
  border: 1px solid rgba(216, 38, 28, .42);
  border-left: 4px solid var(--red);
  animation: shake .38s;
}

/* ---------------------------------------------------------- 输入柜台 */

.input-panel {
  background: linear-gradient(175deg, var(--ink-soft), #1b1710);
  border: 1px solid rgba(246, 239, 221, .12);
  border-top: 1px solid rgba(246, 239, 221, .2);
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 24px 50px -22px rgba(0, 0, 0, .85);
  animation: fade-up .7s .68s both;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 13px;
}

.panel-label {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--cream);
}
.panel-label::before { content: "◆ "; color: var(--red); font-size: 12px; }

.panel-hint { font-size: 11.5px; color: var(--muted); letter-spacing: .05em; }

textarea {
  width: 100%;
  min-height: 128px;
  resize: vertical;
  background: rgba(10, 8, 5, .55);
  border: 1px solid rgba(246, 239, 221, .14);
  border-radius: 4px;
  padding: 14px 15px;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  transition: border-color .2s, box-shadow .2s;
}
textarea::placeholder { color: rgba(151, 144, 126, .6); }
textarea:focus {
  outline: none;
  border-color: rgba(216, 38, 28, .65);
  box-shadow: 0 0 0 3px rgba(216, 38, 28, .14);
}

.input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 15px;
}

.btn-ghost {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--muted);
  background: none;
  border: 1px solid rgba(246, 239, 221, .18);
  border-radius: 3px;
  padding: 11px 18px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.btn-ghost:hover { color: var(--cream); border-color: rgba(246, 239, 221, .45); }

/* 粘贴转链：读剪贴板直转，金色与「清空」区分；不支持的环境由 JS 保持隐藏 */
.btn-paste { margin-right: auto; color: var(--gold); border-color: rgba(201, 163, 95, .42); }
.btn-paste:hover { color: #e8d9ae; border-color: var(--gold); }

.btn-main {
  position: relative;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .3em;
  color: #fff7ea;
  background: linear-gradient(160deg, var(--red) 20%, var(--red-deep));
  border: none;
  border-radius: 3px;
  padding: 12px 26px 12px 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 26px -8px rgba(216, 38, 28, .55), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn-main kbd {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .05em;
  opacity: .72;
  border: 1px solid rgba(255, 247, 234, .4);
  border-radius: 3px;
  padding: 2px 5px;
}
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 15px 32px -8px rgba(216, 38, 28, .65), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-main:active { transform: translateY(0); }
.btn-main[disabled] { filter: grayscale(.35) brightness(.8); cursor: wait; transform: none; }
.btn-main.loading .btn-main-text::after {
  content: "…";
  display: inline-block;
  animation: dots 1s steps(3) infinite;
}

/* ---------------------------------------------------------- 票据 */

.ticket {
  margin-top: 34px;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .55));
  animation: ticket-out .55s cubic-bezier(.2, .9, .3, 1.05) both;
}

/* 锯齿裁切边：米白三角齿，间隙透出墨色页面 */
.ticket-edge {
  height: 12px;
  background:
    linear-gradient(-45deg, var(--paper) 8.5px, transparent 0),
    linear-gradient(45deg,  var(--paper) 8.5px, transparent 0);
  background-size: 17px 17px;
  background-repeat: repeat-x;
  background-position: left bottom;
}
.ticket-edge--bottom { transform: scaleY(-1); }

.ticket-body {
  position: relative;
  background:
    linear-gradient(180deg, rgba(201, 163, 95, .1), transparent 90px),
    var(--paper);
  color: var(--ink-text);
  padding: 20px 26px 18px;
}

.ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 13px;
  border-bottom: 2.5px solid var(--ink-text);
}
.ticket-brand {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .22em;
}
.ticket-no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: #7a6f5c;
}
.ticket-no i { font-style: normal; color: var(--red-deep); font-weight: 700; }

/* 商品档 */
.goods {
  display: flex;
  gap: 16px;
  padding: 16px 0 14px;
}
.goods-img {
  width: 86px; height: 86px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--paper-line);
  background: var(--paper-dim);
  flex: none;
}
.goods-info { min-width: 0; flex: 1; }
.goods-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.goods-shop { margin-top: 4px; font-size: 11.5px; color: #8a7f6a; }

.goods-figures { display: flex; gap: 22px; margin-top: 10px; flex-wrap: wrap; }
.figure { display: flex; flex-direction: column; gap: 2px; }
.figure em { font-style: normal; }
.figure-label { font-size: 10.5px; letter-spacing: .18em; color: #8a7f6a; }
.figure-num {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-text);
}
.figure--gold .figure-num { color: #9d7a35; }
.figure--red .figure-num { color: var(--red-deep); font-size: 22px; }

/* 撕裂线与打孔 */
.tear-line {
  position: relative;
  border-top: 2px dashed rgba(58, 48, 34, .4);
  margin: 2px -26px 4px;
}
.notch {
  position: absolute;
  top: -13px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ink);
}
.notch--l { left: -13px; }
.notch--r { right: -13px; }

/* 结果行 */
.rows { padding-top: 4px; }
.row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--paper-line);
}
.row:last-child { border-bottom: none; }
.row dt {
  flex: none;
  width: 4.8em;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--red-deep);
  padding-top: 2px;
}
.row dd {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-all;
}
.row .empty { color: #a2977f; font-family: var(--sans); font-size: 12px; }

/* 超长链接：单行滚动文本框，不再整段铺开 */
.dd-scroll {
  white-space: nowrap;
  word-break: normal;
  overflow-x: auto;
  background: rgba(58, 48, 34, .06);
  border: 1px solid var(--paper-line);
  border-radius: 4px;
  padding: 9px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(58, 48, 34, .35) transparent;
}
.dd-scroll::-webkit-scrollbar { height: 5px; }
.dd-scroll::-webkit-scrollbar-thumb { background: rgba(58, 48, 34, .3); border-radius: 3px; }
.dd-scroll::-webkit-scrollbar-track { background: transparent; }
/* 空提示状态还原为普通文本 */
.dd-scroll.empty {
  white-space: normal;
  background: none;
  border: 0;
  padding: 0;
  overflow: visible;
}

.btn-copy {
  flex: none;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--red-deep);
  background: none;
  border: 1.5px solid rgba(165, 23, 15, .55);
  border-radius: 3px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .18s, color .18s, transform .12s;
}
.btn-copy:hover { background: var(--red-deep); color: var(--paper); }
.btn-copy:active { transform: scale(.94); }
.btn-copy.copied {
  background: #2e6b3f;
  border-color: #2e6b3f;
  color: var(--paper);
}

/* 复制并打开京东（票据内 + 中央浮层共用） */
.btn-jump {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 15px 0 3px;
  padding: 15px 20px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(160deg, var(--red) 20%, var(--red-deep));
  color: #fff7ea;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .24em;
  border-radius: 4px;
  box-shadow: 0 12px 26px -10px rgba(165, 23, 15, .6), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn-jump i {
  font-style: normal;
  font-family: var(--mono);
  transition: transform .2s;
}
.btn-jump:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -10px rgba(165, 23, 15, .7), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-jump:hover i { transform: translateX(5px); }
.btn-jump:active { transform: translateY(0) scale(.985); }
.btn-jump[disabled] { filter: grayscale(.2) brightness(.92); cursor: default; transform: none; }

/* ---------------------------------------------------------- 中央浮层 */

/* 浮层展开时锁住背景滚动：iOS 上 overflow:hidden 不可靠（单指锁死、双指还能滚），
 * 改用 position:fixed 定身，top 由 JS 记录的滚动位置写入，解锁时还原 */
body.overlay-open {
  position: fixed;
  left: 0; right: 0;
  width: 100%;
  overflow: hidden;
}

.jump-overlay {
  position: fixed;
  /* 不用 inset 简写：iOS 14.5 之前不支持，浮层会跑到屏幕外且锁死页面 */
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 8, 5, .74);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in .22s both;
}

.jump-card {
  position: relative;
  width: min(420px, 100%);
  background:
    linear-gradient(180deg, rgba(201, 163, 95, .12), transparent 70px),
    var(--paper);
  color: var(--ink-text);
  border-radius: 8px;
  padding: 24px 22px 14px;
  text-align: center;
  box-shadow: 0 44px 90px -22px rgba(0, 0, 0, .8);
  animation: card-pop .45s cubic-bezier(.2, 1.5, .4, 1) both;
}
.jump-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--red-deep), var(--red) 45%, var(--gold) 130%);
}

.jump-card-title {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .22em;
  color: var(--red-deep);
}

.jump-card-goods {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: #6f6452;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jump-card .btn-jump { margin: 16px 0 6px; }

.jump-later {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .1em;
  color: #8a7f6a;
  padding: 10px 14px;
  text-decoration: underline dotted rgba(138, 127, 106, .6);
  text-underline-offset: 4px;
}
.jump-later:active { color: var(--ink-text); }

@keyframes card-pop {
  from { opacity: 0; transform: scale(1.32); }
  60%  { opacity: 1; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* 手机端浮层改底部抽屉，从下滑入 */
@keyframes sheet-up {
  from { transform: translateY(100%); }
}

/* 印章 */
.stamp {
  position: absolute;
  right: 30px; bottom: 56px;
  width: 96px; height: 96px;
  border: 3.5px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: .1em;
  text-align: center;
  transform: rotate(-14deg);
  mix-blend-mode: multiply;
  opacity: .88;
  pointer-events: none;
  box-shadow: inset 0 0 0 1.5px rgba(216, 38, 28, .4);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.9 0.9 0.9 0 -0.42'/%3E%3C/filter%3E%3Crect width='96' height='96' filter='url(%23m)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.9 0.9 0.9 0 -0.42'/%3E%3C/filter%3E%3Crect width='96' height='96' filter='url(%23m)'/%3E%3C/svg%3E");
}
.stamp.stamping { animation: stamp-in .5s cubic-bezier(.2, 1.7, .45, 1) both; }

.ticket-foot {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 2.5px solid var(--ink-text);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: #8a7f6a;
}

/* ---------------------------------------------------------- 页脚 */

.footer {
  margin-top: 58px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .12em;
  color: rgba(151, 144, 126, .68);
}

.hidden { display: none !important; }

/* ---------------------------------------------------------- 动画 */

@keyframes fade-in { from { opacity: 0; } }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
}

@keyframes char-drop {
  from { opacity: 0; transform: translateY(-.4em) rotate(-6deg); }
}

@keyframes stamp-in {
  0%   { opacity: 0; transform: rotate(-14deg) scale(2.2); }
  55%  { opacity: 1; transform: rotate(-14deg) scale(.9); }
  75%  { transform: rotate(-14deg) scale(1.07); }
  100% { opacity: .88; transform: rotate(-14deg) scale(1); }
}
.seal-logo { animation-name: seal-in; }
@keyframes seal-in {
  0%   { opacity: 0; transform: rotate(8deg) scale(1.9); }
  60%  { opacity: 1; transform: rotate(8deg) scale(.92); }
  100% { opacity: 1; transform: rotate(8deg) scale(1); }
}

@keyframes ticket-out {
  from { opacity: 0; transform: translateY(26px) scale(.985); }
}

@keyframes shake {
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-3px); }
  90% { transform: translateX(2px); }
}

@keyframes dots { to { transform: translateX(0); } }

/* ---------------------------------------------------------- 响应式 */

@media (max-width: 860px) {
  .side-note { display: none; }
}

/* 手机端：紧凑布局 + 更大的触控目标 */
@media (max-width: 560px) {
  .page {
    padding: 52px 14px 48px;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .topline { height: 4px; }

  .seal-logo { width: 46px; height: 46px; font-size: 15px; top: 0; right: 0; border-radius: 8px; }
  .hero { margin-bottom: 26px; }
  .hero-eyebrow { font-size: 10px; letter-spacing: .2em; margin-bottom: 12px; padding-right: 56px; }
  .hero-title { font-size: 48px; font-size: clamp(40px, 13vw, 56px); }
  .hero-sub { font-size: 13.5px; line-height: 1.85; margin-top: 14px; }
  .bg-glyph { font-size: 230px; left: -46px; bottom: -60px; }

  .notice { font-size: 13px; padding: 11px 13px; }

  .input-panel { padding: 14px; border-radius: 8px; }
  .panel-head { flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 10px; }
  textarea { font-size: 16px; /* ≥16px 防止 iOS 聚焦时自动放大页面 */ min-height: 116px; padding: 12px; }
  /* 按钮布局：无粘贴键时一行「清空|立即转链」；有粘贴键时两行，主按钮整宽贴近拇指 */
  .input-actions { margin-top: 12px; gap: 10px; flex-wrap: wrap; }
  .btn-ghost { padding: 13px 15px; }
  .btn-main { flex: 1; justify-content: center; padding: 14px 16px; letter-spacing: .2em; }
  .has-paste .btn-paste, .has-paste .btn-clear { flex: 1; margin-right: 0; padding: 13px 10px; }
  .has-paste .btn-main { flex-basis: 100%; }
  .btn-main kbd { display: none; }

  .ticket { margin-top: 24px; }
  .ticket-body { padding: 14px 14px 12px; }
  .ticket-head { padding-bottom: 10px; }
  .ticket-brand { font-size: 13px; letter-spacing: .12em; }
  .tear-line { margin-left: -14px; margin-right: -14px; }
  .notch { width: 22px; height: 22px; top: -11px; }
  .notch--l { left: -11px; }
  .notch--r { right: -11px; }

  .goods { gap: 12px; padding: 13px 0 11px; }
  .goods-img { width: 64px; height: 64px; }
  .goods-name { font-size: 13px; }
  .goods-figures { gap: 10px 18px; margin-top: 8px; }
  .figure-num { font-size: 17px; }
  .figure--red .figure-num { font-size: 19px; }

  /* 结果行改上下结构：标签+复制按钮一行，链接内容整行铺开更易读 */
  .row { flex-wrap: wrap; gap: 7px 10px; padding: 12px 0; }
  .row dt { width: auto; flex: 1; padding-top: 0; }
  .row .btn-copy { order: 2; padding: 8px 18px; }
  .row dd { order: 3; flex-basis: 100%; font-size: 13px; }

  .btn-jump { font-size: 15px; padding: 15px 16px; letter-spacing: .16em; margin: 12px 0 2px; }
  /* 浮层改为底部抽屉：整宽贴底、圆角朝上、避开 iPhone 底部横条 */
  .jump-overlay { padding: 0; align-items: flex-end; }
  .jump-card {
    width: 100%;
    border-radius: 18px 18px 0 0;
    padding: 22px 18px 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    animation: sheet-up .38s cubic-bezier(.22, .9, .3, 1) both;
  }
  .jump-card::before { border-radius: 18px 18px 0 0; }
  .jump-card .btn-jump { margin: 14px 0 4px; }
  .jump-later { padding: 12px 16px; }
  .stamp { width: 74px; height: 74px; font-size: 17px; border-width: 3px; right: 10px; bottom: 64px; }
  .ticket-foot { font-size: 9.5px; letter-spacing: .04em; }

  .footer { margin-top: 40px; font-size: 10.5px; padding: 0 6px; }
}

/* 触屏设备：去掉悬停位移，交互反馈交给 :active */
@media (hover: none) {
  .btn-main:hover { transform: none; box-shadow: 0 10px 26px -8px rgba(216, 38, 28, .55), inset 0 1px 0 rgba(255, 255, 255, .22); }
  .btn-jump:hover { transform: none; }
  .btn-jump:hover i { transform: none; }
  .btn-copy:hover { background: none; color: var(--red-deep); }
  .btn-copy:active { background: var(--red-deep); color: var(--paper); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; }
}
