/* TearTicket Component Styles (Vanilla CSS) */
.tear-ticket-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 16px 20px;
}

/* 极简风格 Reset 刷新按钮（纯净、克制、丝滑交互，无冗余动效） */
.tear-ticket-reset-btn {
  align-self: flex-end;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 35px;
  padding: 0 16px 0 13px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #64748b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 180ms ease,
              border-color 180ms ease,
              color 180ms ease,
              box-shadow 180ms ease,
              transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

/* 丝滑悬停：轻微上浮与提亮，静止不乱转 */
.tear-ticket-reset-btn:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.16);
  color: #0f172a;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.03);
  transform: translateY(-1px);
}

/* 触觉按下：轻快微下压反馈 */
.tear-ticket-reset-btn:active {
  transform: translateY(0) scale(0.96);
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition-duration: 70ms;
}

.tear-ticket-reset-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.1;
  transform-origin: center center;
}

/* 点击重置时触发单次轻盈 360 度顺畅旋转 */
.tear-ticket-reset-btn.is-resetting svg {
  animation: resetIconSpin 450ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes resetIconSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.tear-ticket {
  --tt-w: 640px;
  --tt-h: 360px;
  --tt-stub: 200px;
  --tt-bg: #ffffff;
  --tt-stub-bg: #ffffff;
  --tt-ink: #18181b;
  --tt-edge: rgba(0, 0, 0, 0.07);
  --tt-edge-w: 1;
  --tt-parallax: 6px;
  --tt-body-w: 440px;
  --tt-body-h: 360px;
  --tt-fit: 1;

  position: relative;
  width: min(var(--tt-w), 100%);
  margin-top: 24px;
  color: var(--tt-ink);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.tear-ticket[data-disabled] {
  opacity: 0.6;
}

.tear-ticket__stage {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--tt-w);
  height: var(--tt-h);
  transform: scale(var(--tt-fit));
  transform-origin: top left;
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tear-ticket[data-shift='x'] .tear-ticket__stage {
  transform: translateX(calc(var(--tt-stub) * var(--tt-fit) / 2)) scale(var(--tt-fit));
}

.tear-ticket[data-shift='y'] .tear-ticket__stage {
  transform: translateY(calc(var(--tt-stub) * var(--tt-fit) / 2)) scale(var(--tt-fit));
}

/* 卡片背景动态环境柔光投射阴影（随 3D Tilt 视差反向光影位移，三段式独立管理，存根撕下时对应阴影平滑消失） */
.tear-ticket__shadow {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--tt-w);
  height: var(--tt-h);
  pointer-events: none;
  transform-origin: center center;
  will-change: transform, opacity;
  z-index: 0;
  transition: opacity 300ms ease;
  transform: translate3d(0, 18px, 0) rotate(3.5deg);
}

.tear-ticket__shadow-part {
  position: absolute;
  pointer-events: none;
  transition: opacity 320ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 320ms ease;
  will-change: opacity, transform;
}

/* 主票体环境柔光阴影 (左侧主体) */
.tear-ticket__shadow-part--body {
  left: 14px;
  top: 12px;
  width: 432px;
  height: 340px;
  border-radius: 26px 8px 8px 26px;
  background: radial-gradient(ellipse at 48% 52%, rgba(15, 23, 42, 0.22) 0%, rgba(15, 23, 42, 0.10) 48%, rgba(15, 23, 42, 0.02) 72%, transparent 82%);
  filter: blur(22px);
}

.tear-ticket__shadow-part--body::after {
  content: "";
  position: absolute;
  inset: 10px 10px 4px 14px;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.14);
  filter: blur(10px);
}

/* 上副券环境柔光阴影 (右上电话/微信存根) */
.tear-ticket__shadow-part--stub-top {
  left: 436px;
  top: 12px;
  width: 188px;
  height: 168px;
  border-radius: 6px 26px 6px 6px;
  background: radial-gradient(ellipse at 50% 50%, rgba(15, 23, 42, 0.20) 0%, rgba(15, 23, 42, 0.09) 50%, transparent 78%);
  filter: blur(20px);
}

.tear-ticket__shadow-part--stub-top::after {
  content: "";
  position: absolute;
  inset: 10px 14px 4px 8px;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.13);
  filter: blur(10px);
}

/* 下副券环境柔光阴影 (右下留言邮箱存根) */
.tear-ticket__shadow-part--stub-bottom {
  left: 436px;
  top: 180px;
  width: 188px;
  height: 172px;
  border-radius: 6px 6px 26px 6px;
  background: radial-gradient(ellipse at 50% 50%, rgba(15, 23, 42, 0.20) 0%, rgba(15, 23, 42, 0.09) 50%, transparent 78%);
  filter: blur(20px);
}

.tear-ticket__shadow-part--stub-bottom::after {
  content: "";
  position: absolute;
  inset: 4px 14px 4px 8px;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.13);
  filter: blur(10px);
}

/* 撕下右侧对应内容后，阴影立即自然消失并略微缩退 */
.tear-ticket[data-stub-top-torn] .tear-ticket__shadow-part--stub-top,
.tear-ticket__shadow-part--stub-top.is-torn {
  opacity: 0 !important;
  transform: translate3d(8px, -4px, 0) scale(0.95);
  pointer-events: none;
}

.tear-ticket[data-stub-bottom-torn] .tear-ticket__shadow-part--stub-bottom,
.tear-ticket__shadow-part--stub-bottom.is-torn {
  opacity: 0 !important;
  transform: translate3d(8px, 4px, 0) scale(0.95);
  pointer-events: none;
}

/* 两节都撕下时，主体阴影右侧收成完整柔和圆角 */
.tear-ticket[data-used] .tear-ticket__shadow-part--body,
.tear-ticket[data-stub-top-torn][data-stub-bottom-torn] .tear-ticket__shadow-part--body {
  border-radius: 26px;
}

.tear-ticket__plane {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.tear-ticket__piece {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tear-ticket__piece--stub {
  outline: none;
  will-change: transform;
  pointer-events: none;
}

.tear-ticket__edge {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.tear-ticket__edge path {
  fill: none;
  stroke: var(--tt-edge);
  stroke-width: var(--tt-edge-w);
}

.tear-ticket__paper {
  position: absolute;
  inset: 0;
  background: var(--tt-bg);
  box-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(15, 23, 42, 0.03), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.tear-ticket__paper--stub {
  background: var(--tt-stub-bg);
  cursor: grab;
  touch-action: none;
  transition: background-color 200ms ease;
}

.tear-ticket__paper--stub:hover {
  background: #fbfbfb;
}

.tear-ticket[data-grabbing] .tear-ticket__paper--stub {
  cursor: grabbing;
}

.tear-ticket[data-disabled] .tear-ticket__paper--stub {
  cursor: default;
}

.tear-ticket__content {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(var(--tt-w) - var(--tt-stub));
  transition: opacity 500ms ease, filter 500ms ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 34px 28px 36px;
  box-sizing: border-box;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.ticket-body-header,
.ticket-body-main,
.ticket-body-footer {
  transition: opacity 500ms ease, filter 500ms ease;
}

.tear-ticket[data-used] .ticket-body-header,
.tear-ticket[data-used] .ticket-body-main,
.tear-ticket[data-used] .ticket-body-footer {
  opacity: 0.52;
  filter: grayscale(0.4);
}

/* 主票体文字版面：顶部简洁 Kicker 与年份 */
.ticket-body-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.ticket-kicker-group {
  display: inline-flex;
  align-items: center;
  gap: 6.5px;
}

.ticket-kicker-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #0f172a;
  flex-shrink: 0;
}

.ticket-kicker {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #1e3a8a;
  line-height: 1;
}

.ticket-serial {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.06em;
}

/* 主票体文字版面：主体文案与行动号召 */
.ticket-body-main {
  margin: auto 0;
  transform: translateY(14px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ticket-quote-lead {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #475569;
  line-height: 1.75;
  text-indent: 2em;
  letter-spacing: 0.015em;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.ticket-quote-sub {
  margin: 7px 0 0 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 15.5px;
  font-weight: 400;
  color: #1e293b;
  line-height: 1.6;
  letter-spacing: -0.01em;
  text-indent: 0;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.ticket-key-text {
  font-size: 18.5px;
  font-weight: 700;
  color: #090d16;
  letter-spacing: -0.02em;
}

/* 主票体文字版面：底部个人落款、状态与交互提示 */
.ticket-body-footer {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid rgba(241, 245, 249, 0.95);
}

.ticket-footer-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
}

.ticket-brand-group {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

.ticket-brand {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.ticket-brand-sub {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
}

.ticket-date {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
}

/* 撕副券交互提示标注（文字放大，面积仅向下拓展，绝不上移推挤落款） */
.ticket-tear-hint {
  display: inline-flex;
  align-items: center;
  gap: 6.5px;
  margin-left: -4px;
  margin-top: 6px;
  margin-bottom: -12px;
  padding: 4px 10px 4px 7.5px;
  border-radius: 6px;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.95);
  color: #334155;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  width: fit-content;
}

.ticket-tear-hint-mark {
  color: #1e3a8a;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}

/* 撕开后呈现的极简雅致印戳 */
.ticket-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.1) rotate(-10deg);
  pointer-events: none;
  opacity: 0;
  transition: all 450ms cubic-bezier(0.16, 1, 0.3, 1);
  padding: 6px 16px;
  border: 1.8px solid #1e3a8a; /* 纯正沉稳藏青色边框，清晰不透明 */
  border-radius: 9999px;
  background: #ffffff; /* 实体纯白底板，完全不透明，消除半透明发虚 */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px -4px rgba(30, 58, 138, 0.22), 0 2px 6px -1px rgba(30, 58, 138, 0.12);
  z-index: 5;
}

.ticket-stamp-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ticket-stamp-en {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #1e3a8a; /* 藏青色 */
  line-height: 1.15;
}

.ticket-stamp-cn {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.42em;
  margin-right: -0.42em; /* 消除尾部字距偏移，确保视觉绝对居中 */
  color: #1e3a8a; /* 藏青色 */
  line-height: 1.15;
}

.tear-ticket[data-used] .ticket-stamp {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(-8deg);
}

/* 副券存根排版（上下等分两节：高度各 180px，严格几何互斥，零面积重叠） */
.tear-ticket__piece--stub-top,
.tear-ticket__piece--stub-bottom {
  outline: none;
  will-change: transform;
  pointer-events: none; /* 外层 piece 设为 none，杜绝全尺寸透明遮罩相互抢占事件 */
  position: absolute;
  inset: 0;
}

/* 纸张背景层不拦截事件，由精确的 stub 内容容器接管 hit-test */
.tear-ticket__paper--stub {
  pointer-events: none;
}

.tear-ticket__stub--top {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--tt-stub);
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 22px 16px 24px;
  box-sizing: border-box;
  text-align: left;
  pointer-events: auto; /* 仅在上半区 (y: 0~180) 响应交互 */
  cursor: grab;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.tear-ticket__stub--bottom {
  position: absolute;
  top: 180px;
  right: 0;
  width: var(--tt-stub);
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 22px 18px 24px;
  box-sizing: border-box;
  text-align: left;
  pointer-events: auto; /* 仅在下半区 (y: 180~360) 响应交互 */
  cursor: grab;
}

.tear-ticket[data-grabbing] .tear-ticket__stub--top,
.tear-ticket[data-grabbing] .tear-ticket__stub--bottom {
  cursor: grabbing;
}

.ticket-stub-top {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ticket-stub-eyebrow {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #94a3b8;
  text-transform: uppercase;
}

.ticket-stub-title {
  margin: 2px 0 0 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.ticket-stub-venue {
  margin: 3px 0 0 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
  color: #64748b;
}

/* 副券底部信息（纯文本静态展示，无多余放大动效） */
.ticket-stub-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10px;
  border-top: 1px dashed rgba(226, 232, 240, 0.9);
}

.ticket-stub-no {
  font-family: "Segoe UI", Arial, "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

/* 极简轻量复制成功提示（Toast） */
.tear-ticket-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.25), 0 2px 6px -1px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tear-ticket-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tear-ticket-toast svg {
  width: 14px;
  height: 14px;
  stroke: #22c55e;
  stroke-width: 2.4;
  flex-shrink: 0;
}

.tear-ticket[data-orientation='vertical'] .tear-ticket__content {
  bottom: auto;
  width: 100%;
  height: calc(var(--tt-h) - var(--tt-stub));
}

.tear-ticket[data-orientation='vertical'] .tear-ticket__stub {
  top: auto;
  left: 0;
  width: auto;
  height: var(--tt-stub);
}

.tear-ticket[data-instant] .tear-ticket__stage,
.tear-ticket[data-instant] .tear-ticket__content,
.tear-ticket[data-instant] .tear-ticket__image {
  transition-duration: 0ms;
}

.tear-ticket__fibres {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.tear-ticket__fibres path {
  fill: none;
  stroke: #d4d4d8;
  stroke-linecap: round;
  opacity: 0;
}

.tear-ticket__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .tear-ticket__stage {
    transition: none;
  }
}

/* 保证滚动触底时刷新按钮相对视口位置绝对不动，卡片精准贴近底边框 */
#contact {
  padding-bottom: calc(10rem - 24px) !important;
}

@media (max-width: 520px) {
  .tear-ticket-wrapper {
    padding: 24px 10px 0;
  }
  .tear-ticket {
    margin-top: 16px;
  }
  #contact {
    padding-bottom: calc(5rem - 16px) !important;
  }
}
