:root {
  color-scheme: light;
  --ink: #18212b;
  --muted: #647084;
  --line: #dbe2ea;
  --paper: #f7f9fb;
  --panel: #ffffff;
  --red: #d4372f;
  --green: #15855a;
  --blue: #2167d5;
  --gold: #d79b28;
  --dark: #101723;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

.share-thumb-preload {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(216, 55, 47, 0.08), transparent 34%),
    linear-gradient(235deg, rgba(33, 103, 213, 0.1), transparent 38%),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}

.editor-panel,
.preview-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(219, 226, 234, 0.9);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(24, 33, 43, 0.08);
}

.editor-panel {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.preview-panel {
  padding: 20px;
  position: relative;
}

.mobile-mode-switch {
  display: none;
}

.mobile-qr-dock {
  display: none;
}

.brand-row,
.poster-topline,
.poster-footer,
.match-editor-head,
.export-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 24px;
}

.icon-button,
.remove-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f7;
}

.tab {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(24, 33, 43, 0.08);
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.split-controls {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
}

.matches-editor {
  display: grid;
  gap: 12px;
}

.match-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  background: var(--dark);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
}

.poster {
  position: relative;
  overflow: hidden;
  width: min(100%, 620px);
  min-height: 880px;
  margin: 0 auto;
  padding: 34px;
  border-radius: 8px;
  color: #fff;
  background: #111923;
  isolation: isolate;
  box-shadow: 0 22px 80px rgba(16, 23, 35, 0.26);
}

.poster-topline,
.poster-hero,
.poster-footer,
.match-card {
  transition:
    filter 220ms ease,
    opacity 220ms ease,
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.poster.has-focus .poster-topline,
.poster.has-focus .poster-hero,
.poster.has-focus .poster-footer {
  filter: blur(5px);
  opacity: 0.26;
}

.poster-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(150deg, rgba(212, 55, 47, 0.95) 0 28%, transparent 28% 100%),
    radial-gradient(circle at 88% 12%, rgba(215, 155, 40, 0.55), transparent 26%),
    linear-gradient(145deg, #192434 0%, #0f1721 52%, #1d2937 100%);
}

.poster-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(90deg, #fff 1px, transparent 1px),
    linear-gradient(0deg, #fff 1px, transparent 1px);
  background-size: 32px 32px;
}

.poster-topline {
  display: none;
}

.poster-hero {
  padding: 56px 0 28px;
}

.poster-kicker {
  margin: 0 0 10px;
  color: #ffd166;
  font-size: 14px;
  font-weight: 900;
}

.poster h2 {
  margin: 0;
  max-width: 10em;
  font-size: clamp(40px, 8vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.poster-hero p:last-child {
  margin: 18px 0 0;
  max-width: 28em;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  line-height: 1.55;
}

.match-list {
  display: grid;
  gap: 12px;
}

.match-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 17px;
  background:
    linear-gradient(180deg, rgba(38, 51, 68, 0.86), rgba(15, 24, 36, 0.82)),
    rgba(20, 29, 41, 0.82);
  backdrop-filter: blur(18px);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.32),
    0 3px 10px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.match-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%);
  pointer-events: none;
}

.poster.has-focus .match-card:not(.is-focused) {
  filter: blur(5px) saturate(0.7);
  opacity: 0.26;
  transform: scale(0.985);
  pointer-events: none;
}

.match-card.is-focused {
  z-index: 5;
  transform: translateY(-4px) scale(1.018);
  background: rgba(20, 29, 41, 0.96);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

.match-card.review-card,
.match-card.analysis-card {
  transition:
    min-height 420ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 420ms ease,
    filter 420ms ease,
    box-shadow 420ms ease;
}

.match-card.review-card.is-compact,
.match-card.analysis-card.is-compact {
  padding: 15px 17px;
}

.match-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.match-title {
  margin: 10px 0 8px;
  font-size: 22px;
  font-weight: 950;
}

.review-card .match-title {
  padding-right: 74px;
}

.match-pick {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-weight: 950;
  white-space: nowrap;
}

.match-pick strong,
.result-emphasis {
  color: #ff5548;
  font-weight: 950;
}

.pick-odd {
  margin-left: 2px;
  color: currentColor;
  font-size: 0.92em;
}

.analysis-detail p .result-emphasis,
.review-detail p .result-emphasis,
.review-proof strong .result-emphasis {
  color: #ff5548;
}

.match-reason {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.55;
}

.analysis-compact-row,
.review-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.analysis-summary {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.45;
}

.reference-note {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
}

.analysis-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  animation: focusReveal 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.analysis-detail > span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 900;
}

.analysis-detail p {
  margin: 6px 0 0;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.68;
  text-align: left;
  word-break: normal;
  overflow-wrap: break-word;
}

.compact-pick {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px dashed rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.card-toggle {
  position: relative;
  z-index: 2;
  overflow: hidden;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  padding: 0 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(230, 236, 244, 0.96));
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.analysis-toggle {
  isolation: isolate;
}

.analysis-toggle::before {
  content: "";
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -38%;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
  transform: rotate(18deg);
  opacity: 0;
  animation: ctaSweep 2200ms ease-in-out infinite;
}

.analysis-toggle::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff453a;
  box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.34);
  transform: translateY(-50%);
  animation: ctaPulse 1600ms ease-out infinite;
}

.card-toggle:active {
  transform: translateY(2px);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.22),
    inset 0 2px 5px rgba(24, 33, 43, 0.18);
}

.review-summary {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.review-proof {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.08);
  animation: focusReveal 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.proof-label,
.review-detail > span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 900;
}

.review-proof strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.proof-stamp {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 950;
  transform: rotate(-10deg);
}

.review-detail {
  margin-top: 12px;
  animation: focusReveal 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.review-detail p {
  margin: 5px 0 0;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.68;
  text-align: left;
  word-break: normal;
  overflow-wrap: break-word;
}

.review-detail.result p {
  color: #fff;
  font-weight: 800;
}

.review-badge {
  position: absolute;
  top: 42px;
  right: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #ff5548;
  font-size: 13px;
  font-weight: 950;
}

.match-card.lowHit {
  border-color: rgba(90, 214, 151, 0.88);
  box-shadow: 0 0 0 1px rgba(90, 214, 151, 0.16), 0 0 20px rgba(90, 214, 151, 0.12);
  animation: cardHitShake 520ms cubic-bezier(0.25, 0.9, 0.35, 1) both;
}

.match-card.lowHit .proof-stamp,
.match-card.lowHit .review-proof {
  border-color: rgba(90, 214, 151, 0.72);
}

.match-card.highHit {
  border-color: rgba(255, 209, 102, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.2), 0 0 24px rgba(255, 209, 102, 0.16);
  animation: cardHitShake 520ms cubic-bezier(0.25, 0.9, 0.35, 1) both;
}

.match-card.highHit .proof-stamp,
.match-card.highHit .review-proof {
  border-color: rgba(255, 209, 102, 0.78);
}

.hit-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border: 5px solid currentColor;
  border-radius: 50%;
  color: rgba(255, 78, 58, 0.95);
  background: rgba(255, 78, 58, 0.04);
  font-size: 32px;
  font-weight: 950;
  letter-spacing: 0.04em;
  transform: translate(-50%, -50%) rotate(-16deg) scale(0.72);
  opacity: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.hit-stamp::before,
.hit-stamp::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.hit-stamp::before {
  inset: 7px;
}

.hit-stamp::after {
  inset: 17px;
  opacity: 0.42;
}

.match-card.lowHit .hit-stamp,
.match-card.highHit .hit-stamp,
.match-card.post-hit .today-stamp {
  animation: stampDrop 620ms cubic-bezier(0.18, 0.95, 0.28, 1.18) 130ms both;
}

.match-card.lowHit .hit-stamp,
.match-card.post-hit .today-stamp {
  color: rgba(255, 78, 58, 0.92);
}

.match-card.miss,
.match-card.post-miss {
  filter: saturate(0.58);
  opacity: 0.72;
}

.match-card.miss .hit-stamp,
.match-card.post-miss .today-stamp {
  color: rgba(210, 216, 226, 0.56);
  background: rgba(210, 216, 226, 0.04);
  opacity: 0.74;
  transform: translate(-50%, -50%) rotate(-16deg) scale(0.9);
}

.match-card.no-stamp-motion {
  animation: none;
}

.match-card.no-stamp-motion .hit-stamp {
  animation: none;
  opacity: 0.95;
  transform: translate(-50%, -50%) rotate(-16deg) scale(0.9);
}

.match-card.miss .card-toggle,
.match-card.post-miss .card-toggle {
  background: rgba(255, 255, 255, 0.82);
}

.poster-footer {
  position: absolute;
  top: 112px;
  right: 34px;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.footer-label {
  display: none;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.poster-footer > div:first-child {
  order: 2;
  max-width: 122px;
  text-align: center;
}

.poster-footer strong {
  display: block;
  margin-top: 0;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 33, 0.58);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.poster-footer .qr-wrap {
  order: 1;
}

.qr-wrap {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-weight: 950;
  overflow: hidden;
  mix-blend-mode: var(--qr-blend, normal);
  opacity: var(--qr-opacity, 0.78);
  cursor: pointer;
  -webkit-touch-callout: default;
  -webkit-user-select: none;
  user-select: none;
}

.qr-wrap img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-touch-callout: default;
}

.qr-wrap.has-image img {
  display: block;
}

.qr-wrap.has-image .qr-placeholder {
  display: none;
}

.export-actions {
  justify-content: center;
  margin: 18px auto 12px;
}

.copy-output {
  width: min(100%, 620px);
  min-height: 132px;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}

.card-preview-mode {
  background: #0f1721;
}

.card-preview-mode .app-shell {
  width: 100%;
  padding: 0;
}

.card-preview-mode .workspace {
  display: block;
}

.card-preview-mode .editor-panel,
.card-preview-mode .export-actions,
.card-preview-mode .copy-output {
  display: none;
}

.card-preview-mode .preview-panel {
  min-height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #0f1721;
  box-shadow: none;
}

.card-preview-mode .mobile-mode-switch {
  position: fixed;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(15, 23, 33, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  transform: scale(var(--switch-scale, 1));
  transform-origin: top center;
  transition:
    transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background 620ms ease,
    box-shadow 620ms ease;
}

.card-preview-mode .mobile-mode-switch.is-scrolled {
  background: rgba(15, 23, 33, 0.9);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.mobile-date {
  color: #fff;
  font-size: 17px;
  font-weight: 950;
}

.mobile-mode-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.mobile-mode-tabs::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  border-radius: 999px;
  background: #ffd166;
  box-shadow: 0 8px 20px rgba(255, 209, 102, 0.24);
  transform: translateX(calc(var(--active-index, 1) * 100%));
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mobile-mode-button {
  position: relative;
  z-index: 1;
  min-width: 64px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

#historyBtn {
  color: rgba(255, 255, 255, 0.68);
}

#historyBtn:active {
  transform: translateY(2px);
}

.history-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgba(4, 8, 14, 0.66);
  backdrop-filter: blur(14px);
}

.qr-modal.is-open {
  display: block;
}

.qr-sheet {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(82vw, 340px);
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.qr-sheet img {
  width: min(66vw, 260px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
  -webkit-touch-callout: default;
}

.qr-sheet strong {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 33, 0.58);
  font-size: 16px;
  font-weight: 950;
}

.history-modal.is-open {
  display: block;
}

.history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.58);
  backdrop-filter: blur(12px);
  opacity: 0;
  animation: historyFade 360ms ease forwards;
}

.history-sheet {
  position: absolute;
  left: 14px;
  right: max(14px, calc(100vw - 376px));
  top: 84px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(24, 34, 48, 0.98), rgba(12, 19, 29, 0.98));
  color: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  animation: historySheetIn 520ms cubic-bezier(0.2, 0.8, 0.2, 1) 80ms forwards;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
}

.history-label {
  display: block;
  color: #ffd166;
  font-size: 11px;
  font-weight: 950;
}

.history-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1;
}

.history-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 18px 14px;
}

.history-stats div {
  min-height: 66px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.history-stats span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 900;
}

.history-stats strong {
  display: block;
  margin-top: 5px;
  color: #ff5548;
  font-size: 24px;
  line-height: 1;
}

.history-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0 12px 14px;
}

.history-table {
  width: 100%;
  min-width: 430px;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 12px;
}

.history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 7px;
  background: rgba(12, 19, 29, 0.96);
  color: rgba(255, 255, 255, 0.56);
  text-align: center;
  font-size: 12px;
  font-weight: 950;
}

.history-table td {
  padding: 11px 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  vertical-align: middle;
}

.history-table td:first-child {
  border-radius: 8px 0 0 8px;
  color: rgba(255, 255, 255, 0.62);
}

.history-table td:last-child {
  border-radius: 0 8px 8px 0;
}

.history-table td:nth-child(2) {
  font-weight: 900;
  text-align: center;
}

.history-score {
  color: rgba(255, 255, 255, 0.74);
  font-weight: 950;
}

.history-table td span {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 950;
}

.history-pick-hit {
  color: #ff5548;
}

.history-odds-hit {
  color: #ff5548;
}

.history-odds-miss {
  color: rgba(210, 216, 226, 0.58);
}

.history-separator {
  margin: 0 3px;
  color: rgba(255, 255, 255, 0.34);
}

.record-icon {
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.history-table .is-hit .record-icon {
  background: rgba(255, 85, 72, 0.14);
  color: #ff5548;
}

.history-table .is-miss {
  opacity: 0.7;
}

.history-table .is-miss .record-icon {
  background: rgba(210, 216, 226, 0.1);
  color: rgba(210, 216, 226, 0.72);
}

@keyframes historyFade {
  to {
    opacity: 1;
  }
}

body.card-preview-mode .mobile-qr-dock {
  position: fixed !important;
  top: 72px !important;
  left: calc(min(100vw, 390px) - 82px) !important;
  right: auto !important;
  z-index: 80 !important;
  display: grid !important;
}

body.card-preview-mode .poster.has-focus + .mobile-qr-dock {
  display: none !important;
}

body.card-preview-mode.history-open .mobile-qr-dock {
  display: none !important;
}

@keyframes historySheetIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mobile-mode-button.is-active {
  background: transparent;
  color: var(--ink);
}

.card-preview-mode .poster {
  width: min(100vw, 620px);
  max-width: 100vw;
  height: 100svh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 24px 18px;
  border-radius: 0;
  box-shadow: none;
}

.card-preview-mode .poster-topline {
  display: none;
}

.card-preview-mode .poster-hero {
  flex: 0 0 auto;
  min-height: 214px;
  padding: 88px 70px 16px 0;
}

.card-preview-mode .poster-kicker {
  margin-bottom: 8px;
  font-size: 12px;
}

.card-preview-mode .poster h2 {
  max-width: 8em;
  font-size: 34px;
  line-height: 1.06;
}

.card-preview-mode .poster-hero p:last-child {
  margin-top: 10px;
  max-width: 18em;
  font-size: 15px;
  line-height: 1.45;
}

.card-preview-mode .match-list {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 18px 0;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.card-preview-mode .match-list::-webkit-scrollbar {
  display: none;
}

.card-preview-mode .match-list.has-overflow-matches {
  flex: 0 1 auto;
  max-height: min(560px, calc(100svh - 220px));
  padding: 0 2px 42px 0;
  mask-image: linear-gradient(180deg, #000 0%, #000 90%, transparent 100%);
}

.card-preview-mode .match-card {
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  padding: 13px 14px;
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(35, 48, 64, 0.88), rgba(13, 22, 34, 0.84)),
    rgba(20, 29, 41, 0.84);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.36),
    0 4px 12px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.card-preview-mode .match-meta {
  font-size: 12px;
}

.card-preview-mode .match-title {
  margin: 8px 0 9px;
  font-size: 22px;
  line-height: 1.22;
}

.card-preview-mode .review-card .match-title {
  padding-right: 0;
}

.card-preview-mode .match-pick,
.card-preview-mode .compact-pick {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.card-preview-mode .card-toggle {
  min-width: 142px;
  min-height: 38px;
  padding: 0 16px;
}

.card-preview-mode .analysis-summary,
.card-preview-mode .review-summary {
  display: none;
}

.card-preview-mode .reference-note {
  margin-top: 8px;
  font-size: 10px;
}

.card-preview-mode .match-card.is-focused {
  position: fixed;
  top: calc(50% + 28px);
  left: 16px;
  right: max(16px, calc(100vw - 374px));
  width: auto;
  max-width: none;
  z-index: 18;
  max-height: calc(100svh - 126px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  transform: translateY(-50%);
}

.card-preview-mode .match-card.is-focused .analysis-summary,
.card-preview-mode .match-card.is-focused .review-summary {
  display: block;
}

.card-preview-mode .poster-footer {
  display: none;
}

.card-preview-mode .poster-footer > div:first-child {
  display: block;
  max-width: 96px;
}

.card-preview-mode .poster-footer strong {
  padding: 4px 7px;
  font-size: 11px;
}

.card-preview-mode .qr-wrap {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.card-preview-mode .poster.has-focus .poster-footer {
  display: none;
}

@keyframes shine {
  from {
    transform: translateX(-48%) rotate(8deg);
  }
  to {
    transform: translateX(48%) rotate(8deg);
  }
}

@keyframes stampDrop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-16deg) scale(1.55);
    filter: blur(2px);
  }
  58% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-16deg) scale(0.86);
    filter: blur(0);
  }
  76% {
    transform: translate(-50%, -50%) rotate(-16deg) scale(0.96);
  }
  100% {
    opacity: 0.95;
    transform: translate(-50%, -50%) rotate(-16deg) scale(0.9);
  }
}

@keyframes cardHitShake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  18% {
    transform: translateX(-3px) rotate(-0.45deg);
  }
  34% {
    transform: translateX(3px) rotate(0.45deg);
  }
  50% {
    transform: translateX(-2px) rotate(-0.25deg);
  }
  66% {
    transform: translateX(2px) rotate(0.2deg);
  }
  82% {
    transform: translateX(-1px) rotate(-0.1deg);
  }
}

@keyframes focusReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ctaSweep {
  0%,
  52% {
    opacity: 0;
    transform: translateX(0) rotate(18deg);
  }
  62% {
    opacity: 0.68;
  }
  82%,
  100% {
    opacity: 0;
    transform: translateX(520%) rotate(18deg);
  }
}

@keyframes ctaPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.38);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(255, 69, 58, 0);
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 0;
  }

  .workspace {
    display: block;
  }

  .editor-panel,
  .export-actions,
  .copy-output {
    display: none;
  }

  .preview-panel {
    min-height: 100vh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #0f1721;
    box-shadow: none;
  }

  .mobile-mode-switch {
    position: fixed;
    top: 10px;
    left: 12px;
    right: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 8px 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(15, 23, 33, 0.82);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  }

  .poster {
    width: min(100vw, 620px);
    min-height: 100svh;
    padding: 0 24px 20px;
    border-radius: 0;
    box-shadow: none;
  }

  .poster h2 {
    font-size: 34px;
  }
}

@media (max-width: 520px) {
  .split-controls,
  .match-grid,
  .result-row {
    grid-template-columns: 1fr;
  }

  body.card-preview-mode {
    overflow: hidden;
  }

  .card-preview-mode .mobile-mode-switch {
    top: 8px;
    left: 8px;
    right: auto;
    width: min(calc(100vw - 16px), 374px);
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px;
    min-height: 44px;
  }

  .card-preview-mode .mobile-date {
    position: static;
    flex: 0 0 96px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }

  .card-preview-mode .mobile-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    margin-left: 0;
    min-width: 0;
    gap: 0;
    padding: 3px;
  }

  .card-preview-mode .mobile-mode-button {
    min-width: 0;
    min-height: 32px;
    padding: 0 1px;
    font-size: 8.5px;
    white-space: nowrap;
  }

  .card-preview-mode .mobile-mode-button[data-mobile-mode="recommend"] {
    font-size: 10px;
    font-weight: 1000;
  }

  .card-preview-mode .mobile-qr-dock {
    position: fixed;
    top: 72px;
    left: calc(min(100vw, 390px) - 82px);
    right: auto;
    z-index: 80;
    display: grid;
    justify-items: center;
    gap: 4px;
    width: 68px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    -webkit-touch-callout: default;
  }

  .card-preview-mode .mobile-qr-dock img {
    display: block;
    width: 58px;
    height: 58px;
    padding: 3px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    -webkit-touch-callout: default;
  }

  .card-preview-mode .mobile-qr-dock strong {
    display: block;
    width: 68px;
    padding: 2px 4px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(15, 23, 33, 0.64);
    color: rgba(255, 255, 255, 0.92);
    font-size: 8.5px;
    line-height: 1.1;
    font-weight: 950;
    white-space: normal;
  }

  .card-preview-mode .poster.has-focus + .mobile-qr-dock {
    display: none;
  }

  .card-preview-mode .poster {
    width: 100vw;
    max-width: 100vw;
    padding: 0 14px 14px;
    overflow-x: hidden;
  }

  .card-preview-mode .poster-hero {
    min-height: 160px;
    padding: 72px 66px 6px 0;
  }

  .card-preview-mode .poster h2 {
    max-width: 7em;
    font-size: 26px;
  }

  .card-preview-mode .poster-hero p:last-child {
    max-width: 17em;
    font-size: 12px;
    line-height: 1.35;
  }

  .card-preview-mode .poster-footer {
    top: 84px;
    right: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .card-preview-mode .poster-footer strong {
    max-width: 74px;
    padding: 3px 6px;
    font-size: 10px;
    white-space: normal;
  }

  .card-preview-mode .qr-wrap {
    width: 62px;
    height: 62px;
  }

  .card-preview-mode .match-list.has-overflow-matches {
    max-height: min(640px, calc(100svh - 174px));
    padding-bottom: 34px;
  }

  .card-preview-mode .match-list {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
  }

  .card-preview-mode .match-card {
    padding: 10px 12px;
  }

  .card-preview-mode .match-meta {
    gap: 8px;
    font-size: 10.5px;
  }

  .card-preview-mode .match-title {
    margin: 6px 0 7px;
    font-size: 18px;
  }

  .card-preview-mode .analysis-compact-row,
  .card-preview-mode .review-compact-row {
    width: 100%;
    max-width: 100%;
  }

  .card-preview-mode .analysis-compact-row {
    display: block;
  }

  .card-preview-mode .review-compact-row {
    display: block;
  }

  .card-preview-mode .match-pick,
  .card-preview-mode .compact-pick {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
    letter-spacing: 0;
    white-space: normal;
    line-height: 1.25;
  }

  .card-preview-mode .match-pick strong {
    overflow-wrap: normal;
  }

  .card-preview-mode .reference-note {
    display: none;
  }

  .card-preview-mode .card-toggle {
    width: auto;
    min-width: 0;
    min-height: 32px;
    margin-top: 6px;
    padding: 0 24px 0 14px;
    font-size: 12px;
  }

  .card-preview-mode .analysis-toggle {
    display: block;
    min-width: 116px;
    margin: 8px auto 0;
  }
}

/* 20260524 apple-ui-polish: visual-only overrides, keep confirmed layout and interactions. */
:root {
  --apple-bg: #070b12;
  --apple-panel: rgba(15, 22, 32, 0.72);
  --apple-panel-strong: rgba(12, 18, 28, 0.84);
  --apple-border: rgba(255, 255, 255, 0.18);
  --apple-border-soft: rgba(255, 255, 255, 0.1);
  --apple-highlight: #ffd77a;
  --apple-red: #ff453a;
  --apple-text-soft: rgba(245, 247, 251, 0.72);
  --apple-text-dim: rgba(245, 247, 251, 0.52);
}

body.card-preview-mode {
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 69, 58, 0.26), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(255, 214, 110, 0.18), transparent 28%),
    radial-gradient(circle at 64% 84%, rgba(58, 117, 255, 0.13), transparent 40%),
    var(--apple-bg);
}

.card-preview-mode .preview-panel {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 69, 58, 0.2), transparent 36%),
    radial-gradient(circle at 90% 12%, rgba(255, 214, 110, 0.16), transparent 30%),
    linear-gradient(180deg, #070b12 0%, #0a101a 48%, #05080d 100%);
}

.card-preview-mode .poster {
  background: transparent;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.card-preview-mode .poster-bg {
  background:
    radial-gradient(circle at 7% 10%, rgba(255, 69, 58, 0.32), transparent 33%),
    radial-gradient(circle at 92% 10%, rgba(255, 214, 110, 0.2), transparent 29%),
    radial-gradient(circle at 58% 88%, rgba(52, 119, 255, 0.12), transparent 40%),
    linear-gradient(156deg, rgba(255, 69, 58, 0.24) 0 24%, transparent 24% 100%),
    linear-gradient(180deg, #090f18 0%, #0a101a 55%, #05080d 100%);
}

.card-preview-mode .poster-bg::after {
  opacity: 0.09;
  background-image:
    linear-gradient(114deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 38%, #000 100%);
}

.card-preview-mode .mobile-mode-switch {
  border-color: rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  background: rgba(22, 16, 22, 0.68);
  -webkit-backdrop-filter: blur(26px) saturate(1.28);
  backdrop-filter: blur(26px) saturate(1.28);
  box-shadow:
    0 16px 46px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.card-preview-mode .mobile-mode-switch.is-scrolled {
  background: rgba(14, 18, 28, 0.78);
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.card-preview-mode .mobile-date {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.card-preview-mode .mobile-mode-tabs {
  padding: 4px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-preview-mode .mobile-mode-tabs::before {
  background: linear-gradient(180deg, #fff1b8, #ffd267);
  box-shadow:
    0 10px 24px rgba(255, 210, 103, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.card-preview-mode .mobile-mode-button {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.card-preview-mode .mobile-mode-button.is-active {
  color: #171b22;
}

.card-preview-mode .poster-hero {
  position: relative;
}

.card-preview-mode .poster h2 {
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.card-preview-mode .poster-hero p:last-child {
  color: rgba(245, 247, 251, 0.76);
  font-weight: 500;
}

.card-preview-mode .match-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%),
    rgba(12, 18, 28, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(1.16);
  backdrop-filter: blur(24px) saturate(1.16);
  box-shadow:
    0 20px 58px rgba(0, 0, 0, 0.34),
    0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.card-preview-mode .match-card::before {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), transparent 34%),
    radial-gradient(circle at 86% 0%, rgba(255, 216, 120, 0.1), transparent 28%);
}

.card-preview-mode .match-card.is-focused {
  border-color: rgba(255, 255, 255, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent 40%),
    rgba(10, 16, 26, 0.9);
  box-shadow:
    0 28px 84px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.card-preview-mode .match-meta {
  color: rgba(245, 247, 251, 0.58);
  font-weight: 750;
  min-width: 0;
}

.card-preview-mode .match-meta span {
  min-width: 0;
}

.card-preview-mode .match-meta span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-preview-mode .match-meta span:last-child {
  flex: 0 0 82px;
  width: 82px;
  text-align: right;
  white-space: nowrap;
}

.card-preview-mode .match-title {
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.card-preview-mode .match-pick,
.card-preview-mode .compact-pick {
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(245, 247, 251, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-preview-mode .match-pick strong,
.card-preview-mode .result-emphasis {
  color: var(--apple-red);
}

.card-preview-mode .reference-note {
  color: rgba(245, 247, 251, 0.48);
  font-weight: 650;
}

.card-preview-mode .card-toggle {
  width: auto;
  min-width: 118px;
  border: 0;
  border-radius: 999px;
  padding: 0 28px 0 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 238, 245, 0.96));
  color: #151a22;
  font-weight: 850;
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.card-preview-mode .analysis-compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.card-preview-mode .analysis-toggle {
  justify-self: end;
}

.card-preview-mode .card-toggle:active {
  transform: translateY(2px) scale(0.99);
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.28),
    inset 0 2px 5px rgba(20, 28, 38, 0.18);
}

.card-preview-mode .analysis-detail,
.card-preview-mode .review-detail {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.card-preview-mode .analysis-detail p,
.card-preview-mode .review-detail p,
.card-preview-mode .review-summary {
  color: rgba(245, 247, 251, 0.82);
  font-weight: 450;
}

.card-preview-mode .review-badge {
  background: rgba(255, 255, 255, 0.93);
  color: var(--apple-red);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card-preview-mode .mobile-qr-dock img {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.card-preview-mode .mobile-qr-dock strong,
.qr-sheet strong {
  background: rgba(12, 18, 28, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.qr-modal {
  background: rgba(2, 6, 12, 0.56);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  backdrop-filter: blur(22px) saturate(1.18);
}

.qr-sheet img {
  border-radius: 22px;
}

.history-backdrop {
  background: rgba(2, 6, 12, 0.54);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  backdrop-filter: blur(22px) saturate(1.18);
}

body.card-preview-mode .mobile-qr-dock {
  top: 72px !important;
  right: max(14px, calc((100vw - 620px) / 2 + 14px)) !important;
  left: auto !important;
  width: 68px !important;
  height: auto !important;
  padding: 0 !important;
  display: grid !important;
  justify-items: center !important;
  gap: 4px !important;
  background: transparent !important;
}

body.card-preview-mode .mobile-qr-dock img {
  width: 58px !important;
  height: 58px !important;
  max-width: 58px !important;
  max-height: 58px !important;
  object-fit: cover !important;
}

body.card-preview-mode .mobile-qr-dock strong {
  width: 68px !important;
  max-width: 68px !important;
  font-size: 8.5px !important;
  line-height: 1.1 !important;
  white-space: normal !important;
}

.history-sheet {
  border-color: rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 32%),
    rgba(10, 16, 26, 0.88);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  backdrop-filter: blur(28px) saturate(1.2);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.history-head {
  justify-content: center;
  text-align: center;
}

.history-head > div {
  flex: 1;
}

.history-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.history-stats div,
.history-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
}

.history-table th {
  background: rgba(10, 16, 26, 0.9);
}

.history-table {
  min-width: 0;
  font-size: 10.5px;
}

.history-table th,
.history-table td {
  padding-left: 4px;
  padding-right: 4px;
  font-size: 10.5px;
}

.history-table td span {
  font-size: 10.5px;
}

@media (max-width: 520px) {
  .card-preview-mode .mobile-mode-switch {
    border-radius: 22px;
    background: rgba(20, 16, 22, 0.68);
  }

  .card-preview-mode .mobile-date {
    flex-basis: 98px;
    font-size: 12px;
    font-weight: 950;
  }

  .card-preview-mode .mobile-mode-button {
    min-height: 34px;
    font-size: 8.5px;
  }

  .card-preview-mode .mobile-mode-button[data-mobile-mode="recommend"] {
    font-size: 9.8px;
  }

  .history-sheet {
    left: 8px;
    right: 8px;
    top: 76px;
    bottom: 16px;
  }

  .history-head h2 {
    font-size: 22px;
  }

  .history-stats {
    gap: 6px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .history-stats div {
    min-height: 58px;
    padding: 8px 6px;
  }

  .history-stats span {
    font-size: 10px;
  }

  .history-stats strong {
    font-size: 21px;
  }

  .history-table-wrap {
    padding-left: 8px;
    padding-right: 8px;
  }

  .card-preview-mode .poster-hero {
    min-height: 164px;
  }

  .card-preview-mode .poster h2 {
    font-size: 28px;
  }

  .card-preview-mode .poster-hero p:last-child {
    font-size: 12.5px;
  }

  .card-preview-mode .match-list {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
  }

  .card-preview-mode .match-card {
    width: 100%;
    border-radius: 16px;
  }

  .card-preview-mode .match-meta span:last-child {
    margin-left: auto;
  }

  .card-preview-mode .match-title {
    font-size: 21px;
    text-align: center;
  }

  .card-preview-mode .match-pick,
  .card-preview-mode .compact-pick {
    border-radius: 11px;
  }

  .card-preview-mode .analysis-compact-row {
    display: block;
  }

  .card-preview-mode .analysis-compact-row .match-pick {
    width: 100%;
    white-space: normal;
    line-height: 1.25;
  }

  .card-preview-mode .analysis-toggle {
    display: block;
    width: fit-content;
    min-width: 118px;
    margin: 8px auto 0;
  }

  .card-preview-mode .card-toggle {
    min-height: 34px;
  }
}
