:root {
  --bg0: #fff6e8;
  --bg1: #fffaf2;
  --ink: #4a3218;
  --muted: #8a6a45;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(74, 50, 24, 0.08);
  --accent: #f0a83a;
  --accent-soft: #ffe8c2;
  --accent-strong: #d8891f;
  --miku: #f6c84c;
  --miku-deep: #e89a2e;
  --warn: #d97706;
  --danger: #c2410c;
  --ok: #15803d;
  --info: #0369a1;
  --shadow: 0 8px 24px rgba(232, 154, 46, 0.1);
  --radius: 22px;
  /* 不依赖 Google Fonts，避免国内加载卡住 */
  --font: 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --display: 'Songti SC', 'STSong', 'SimSun', 'Noto Serif SC', serif;
}

html[data-theme='claude'] {
  --bg0: #f8ebe2;
  --bg1: #fff7f1;
  --ink: #3b2418;
  --muted: #7a5b4a;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(59, 36, 24, 0.08);
  --accent: #a85a36;
  --accent-soft: #f3e0d4;
  --accent-strong: #8a4424;
  --shadow: 0 18px 50px rgba(59, 36, 24, 0.08);
}

html[data-theme='query'] {
  --bg0: #eaf1f8;
  --bg1: #f7fafc;
  --ink: #1e2a36;
  --muted: #607080;
  --accent: #2f6f8f;
  --accent-soft: #d9ebf4;
  --accent-strong: #1f526b;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html {
  color-scheme: light;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 92% 12%, rgba(246,200,76,.28), transparent 58%),
    radial-gradient(700px 420px at 8% -5%, rgba(255,255,255,.85), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 48%, #fff);
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* 噜噜全屏水印：清楚可见，但不抢文字 */
.miku-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-height: none;
  transform: none;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: miku-float 7s ease-in-out infinite;
}
.miku-glow {
  position: absolute;
  inset: 8% 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246,200,76,.22), transparent 68%);
  filter: blur(32px);
  animation: miku-pulse 4.2s ease-in-out infinite;
}
.miku-figure {
  position: relative;
  width: min(1080px, 96vw);
  height: auto;
  max-height: 96vh;
  display: block;
  object-fit: contain;
  transform: none;
  /* 柔和水印：够明显，又不压内容 */
  opacity: .38;
  filter:
    saturate(1.05)
    contrast(.96)
    drop-shadow(0 18px 40px rgba(232,154,46,.12));
  /* 中间略淡、四周更清楚，让卡片缝隙和边缘更易看见噜噜 */
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 48%, rgba(0,0,0,.35) 0%, rgba(0,0,0,.75) 42%, rgba(0,0,0,.95) 78%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 48%, rgba(0,0,0,.35) 0%, rgba(0,0,0,.75) 42%, rgba(0,0,0,.95) 78%);
}
@keyframes miku-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes miku-pulse {
  0%, 100% { opacity: .7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
#app { position: relative; z-index: 1; }

/* 首屏必须立刻可见：手机弱网时不能等 JS 才显示（否则白屏像卡住） */
#app {
  opacity: 1;
  transform: none;
}

@keyframes fx-rise {
  from { opacity: .35; }
  to { opacity: 1; }
}
@keyframes fx-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fx-pop {
  from { opacity: .4; }
  to { opacity: 1; }
}
@keyframes fx-soft {
  from { opacity: .5; }
  to { opacity: 1; }
}

.fx-enter {
  animation: fx-rise .18s ease both;
}
.fx-pop {
  animation: fx-pop .16s ease both;
}
.fx-title {
  animation: fx-fade .16s ease both;
}
.fx-soft {
  animation: fx-soft .16s ease both;
}

a { color: inherit; }
button, input, textarea { font: inherit; }

.wrap {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 12px 0 64px;
}
@media (min-width: 1100px) {
  .wrap { padding-right: 0; }
  .hero-copy { max-width: min(820px, 100%); }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #10a37f;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  flex-shrink: 0;
  overflow: hidden;
  transition: background .35s ease, transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease;
}
.brand-mark.is-swap {
  transform: scale(.92);
}

.brand-mark img {
  width: 26px;
  height: 26px;
  display: block;
  transition: opacity .2s ease, transform .28s ease;
}
html[data-theme='gpt'] .brand-mark { background: #10a37f; }
html[data-theme='claude'] .brand-mark { background: #d97757; }
html[data-theme='query'] .brand-mark { background: #2f6f8f; }

.brand-text strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: .01em;
  transition: color .3s ease;
}
.brand-tag {
  display: block;
  margin-top: 2px;
  font-size: .78rem;
  color: var(--miku-deep);
  letter-spacing: .04em;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  padding: 5px;
  border-radius: 999px;
}
.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: .85rem;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
.lang-switch button:hover:not(.active) {
  background: rgba(255,255,255,.95);
  color: var(--ink);
}
.lang-switch button.active {
  background: var(--miku);
  color: #4a3218;
  box-shadow: 0 8px 16px rgba(232,154,46,.28);
}

.hero {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 4px 8px 8px;
  box-shadow: none;
  margin-bottom: 10px;
  transition: none;
  position: relative;
  overflow: visible;
}
.hero::after { display: none; }
.hero-copy {
  position: relative;
  z-index: 2;
  max-width: min(820px, 100%);
}
.hero-kicker {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  width: fit-content;
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.6vw, 2.15rem);
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.3;
  color: #c47a12;
  text-shadow:
    0 0 1px rgba(255,255,255,.95),
    0 1px 0 rgba(255,255,255,.95),
    0 8px 24px rgba(255,255,255,.7);
}
.hero-kicker::after {
  content: '';
  display: block;
  width: 2.8em;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f6c84c, rgba(246,200,76,.15));
}

.hero h1 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: -.01em;
  font-weight: 600;
  color: var(--accent-strong);
  text-shadow: 0 1px 0 rgba(255,255,255,.9), 0 8px 24px rgba(255,255,255,.55);
}
.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 52ch;
  text-shadow: 0 1px 0 rgba(255,255,255,.85);
}

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eef7ff;
  border: 1px solid #cfe5f8;
  color: #1d4f74;
  font-size: .92rem;
  line-height: 1.5;
}
html[data-theme='claude'] .notice {
  background: #fff3e8;
  border-color: #f0d4bc;
  color: #7a4124;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.stat {
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
}
.stat strong {
  display: block;
  font-size: 1.15rem;
  color: var(--accent-strong);
}
.stat span {
  color: var(--muted);
  font-size: .82rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}
.grid.query-only {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin: 0 auto;
}
.grid [hidden] { display: none !important; }

.panel {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#guidePanel,
#redeemPanel {
  align-self: stretch;
}
#guidePanel .faq {
  margin-top: auto !important;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.steps {
  display: grid;
  gap: 14px;
}
.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .85rem;
}
.step h3 {
  margin: 0 0 4px;
  font-size: .98rem;
}
.step p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
}
.step .actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 8px;
}
.step .actions .btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .18s ease, filter .18s ease, background .22s ease, box-shadow .22s ease, opacity .18s ease;
}
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.btn.is-busy {
  opacity: .85;
  cursor: wait;
  position: relative;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.03); }
.btn-primary:active:not(:disabled) { filter: brightness(.98); }
.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--accent-soft); }
.btn-block { width: 100%; padding: 14px 18px; font-size: 1rem; }

.mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.mode-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
}
.mode-tabs button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: transparent;
}

.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.sub-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: .86rem;
}
.sub-tabs button.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.sub-tabs button .count {
  margin-left: 4px;
  opacity: .8;
  font-weight: 500;
}

.product-groups {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}
.product-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--accent-strong);
}
.product-group-title span {
  color: var(--muted);
  font-weight: 500;
  font-size: .78rem;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.product {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
  min-height: 88px;
}
.product:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.product:active { filter: brightness(.99); }
.product.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.product.disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.2);
}
.product .name {
  font-weight: 700;
  font-size: .92rem;
  margin-bottom: 8px;
  line-height: 1.3;
}
.product .meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: .78rem;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f8ee;
  color: var(--ok);
  font-weight: 600;
}
.badge.sold {
  background: #fde8e4;
  color: var(--danger);
}
.badge.soon {
  background: #f3e8ff;
  color: #7c3aed;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.hint {
  font-size: .84rem;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.5;
}

.field { margin-bottom: 14px; }
.field label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: .92rem;
}
.field label .req { color: var(--danger); }
.field input,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
  transition: .15s ease;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.field .help {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: .82rem;
  line-height: 1.5;
}

.benefits {
  margin: 8px 0 16px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.65);
  border: 1px dashed var(--line);
}
.benefits h4 { margin: 0 0 8px; font-size: .92rem; }
.benefits ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .88rem; line-height: 1.7; }

.result {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: .92rem;
  line-height: 1.55;
  transform-origin: top center;
}
.result.show {
  display: block;
  animation: fx-pop .32s cubic-bezier(.22, 1, .36, 1) both;
}
.result.ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.result.err { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.result.info { border-color: #bae6fd; background: #f0f9ff; color: #075985; }
.result code {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,.05);
  font-size: .82rem;
  word-break: break-all;
}

.faq {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.faq-item {
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.faq-item strong { display: block; margin-bottom: 4px; }
.faq-item p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.faq-action,
button.faq-action,
#btnOpenSub {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 14px 16px;
  border: 1px solid #e8a830 !important;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffe08a 0%, #f6c84c 48%, #e89a2e 100%) !important;
  background-color: #f6c84c !important;
  color: #4a3218 !important;
  box-shadow: 0 10px 22px rgba(232, 154, 46, 0.22);
  transition: border-color .15s ease, background .15s ease, filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.faq-action:hover,
button.faq-action:hover,
#btnOpenSub:hover {
  border-color: #d8891f !important;
  background: linear-gradient(135deg, #ffe9a8 0%, #f6c84c 48%, #df9228 100%) !important;
  background-color: #f0b83a !important;
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(232, 154, 46, 0.28);
}
.faq-action:active,
#btnOpenSub:active { transform: translateY(0); }
.faq-action-label,
#btnOpenSub .faq-action-label {
  font-weight: 700;
  font-size: .98rem;
  color: #4a3218 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
}
.faq-action-hint,
#btnOpenSub .faq-action-hint {
  font-size: .82rem;
  color: rgba(74, 50, 24, 0.82) !important;
  font-weight: 500;
}
.faq-action strong,
#btnOpenSub strong { color: #4a3218 !important; }

.query-card .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .88rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  margin-bottom: 12px;
}
.query-meta {
  display: grid;
  gap: 8px;
}
.query-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.query-meta span { color: var(--muted); }
.query-meta strong { text-align: right; word-break: break-all; }

.order-status { margin: 0; }
.order-headline {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .01em;
  margin: 0 0 6px;
}
.order-detail {
  margin: 0 0 12px;
  line-height: 1.55;
  opacity: .95;
}
.account-preview {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, .22);
  background: linear-gradient(180deg, rgba(240, 253, 250, .98), rgba(236, 253, 245, .92));
  color: #115e59;
  animation: fx-rise .3s cubic-bezier(.22, 1, .36, 1) both;
}
.account-preview[hidden] { display: none !important; animation: none; }
.account-preview-title {
  font-weight: 700;
  margin: 0 0 4px;
  font-size: .98rem;
}
.account-preview-hint {
  margin: 0 0 10px;
  font-size: .84rem;
  line-height: 1.45;
  opacity: .88;
}
.account-preview .account-line {
  border-top-color: rgba(15, 118, 110, .12);
}
.plan-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 700;
  background: rgba(13, 148, 136, .12);
  color: #0f766e;
  letter-spacing: .02em;
}
.plan-pill.is-free {
  background: rgba(100, 116, 139, .14);
  color: #334155;
}
.plan-pill.is-plus,
.plan-pill.is-pro {
  background: rgba(217, 119, 6, .14);
  color: #9a3412;
}
.account-preview-busy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: .86rem;
  opacity: .9;
}
.account-preview-err {
  margin-top: 8px;
  font-size: .86rem;
  color: #b45309;
}

.account-verify {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(217, 119, 6, .28);
  background: rgba(255, 247, 237, .95);
  color: #9a3412;
}
.result.ok .account-verify {
  border-color: rgba(22, 163, 74, .28);
  background: rgba(240, 253, 244, .95);
  color: #166534;
}
.result.err .account-verify {
  border-color: rgba(220, 38, 38, .25);
  background: rgba(254, 242, 242, .95);
  color: #991b1b;
}
.account-verify-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.account-verify-hint {
  margin: 0 0 10px;
  font-size: .86rem;
  line-height: 1.45;
  opacity: .9;
}
.account-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px dashed rgba(0,0,0,.08);
  font-size: .92rem;
}
.account-line span { opacity: .8; flex: 0 0 auto; }
.account-line strong { text-align: right; word-break: break-all; }
.account-value { font-size: 1.02rem; }

.tool-bar {
  margin: 18px 0 8px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(47, 111, 143, .18);
  background: linear-gradient(180deg, rgba(232, 244, 250, .95), rgba(247, 250, 252, .9));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 14px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  color: #fff;
  transition: transform .15s ease, filter .15s ease;
}
.tool-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.tool-btn-refresh { background: #2f6f8f; }
.tool-btn-sub { background: #e89a2e; color: #4a3218; }
html[data-theme='claude'] .tool-btn-sub { background: #e89a2e; color: #4a3218; }
.tool-ico {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}
.tool-bar-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.45;
}
.modal-card-wide { width: min(720px, 94vw); }
.sub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}
.sub-actions .btn { width: auto; padding: 10px 14px; }
.sub-kv {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.sub-kv .order-row span { min-width: 5.5em; }
@media (max-width: 720px) {
  .tool-bar { grid-template-columns: 1fr; }
}

.order-meta {
  display: grid;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(0,0,0,.06);
}
.order-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: .92rem;
}
.order-row span { color: var(--muted); flex: 0 0 auto; }
.order-row strong { text-align: right; word-break: break-all; }
.order-row .mono { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.order-actions .btn {
  width: auto;
  padding: 8px 12px;
  font-size: .88rem;
}

.batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.batch-actions .btn {
  width: auto;
  padding: 10px 14px;
}
.batch-actions .meta {
  color: var(--muted);
  font-size: .85rem;
}
.batch-summary {
  font-weight: 700;
  margin-bottom: 12px;
}
.batch-table tr.row-unused {
  background: rgba(34, 197, 94, 0.08);
}
.batch-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.65);
}
.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.batch-table th,
.batch-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.batch-table th {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.batch-table tr:last-child td { border-bottom: 0; }
.batch-table .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.batch-table .badge.ok { background: #dcfce7; color: #166534; }
.batch-table .badge.bad { background: #fee2e2; color: #991b1b; }
.batch-table .badge.warn { background: #ffedd5; color: #9a3412; }

.footer {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
}

.products-skeleton { padding: 4px 0 8px; }
.products-skeleton .sk-line {
  height: 12px;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,0,0,.06), rgba(0,0,0,.12), rgba(0,0,0,.06));
  background-size: 200% 100%;
  animation: sk-shine 1.1s linear infinite;
  margin-bottom: 12px;
}
.products-skeleton .sk-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.products-skeleton .sk-cards i {
  display: block;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,.1), rgba(0,0,0,.05));
  background-size: 200% 100%;
  animation: sk-shine 1.1s linear infinite;
}
@keyframes sk-shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.45);
  display: none;
  place-items: center;
  z-index: 50;
  pointer-events: none;
}
.loading-overlay.above-modal { z-index: 120; }
.loading-overlay.show {
  display: grid;
  pointer-events: auto;
}
.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,.08);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.spinner-inline {
  width: 22px;
  height: 22px;
  border-width: 2px;
  flex: 0 0 auto;
}
.sub-busy {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fx-fade .2s ease both;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 26, .4);
}
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 18px 18px 16px;
  animation: fx-pop .28s cubic-bezier(.22, 1, .36, 1) both;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.modal-head h3 { margin: 0; font-size: 1.1rem; }
.modal-body {
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.65;
}
.modal-body ol { margin: 0; padding-left: 1.2em; }
.modal-body li { margin: 8px 0; }
.modal-body code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  word-break: break-all;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: .88rem;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 90;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —— 卡密优先三步向导 —— */
.wizard-steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.wizard-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.82);
  color: var(--muted);
  font-size: .88rem;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.wizard-steps li:hover {
  border-color: color-mix(in srgb, var(--miku) 35%, var(--line));
  background: #fff;
}
.wizard-steps li:focus-visible {
  outline: 2px solid var(--miku);
  outline-offset: 2px;
}
.wizard-steps li .n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.wizard-steps li.active {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}
.wizard-steps li.active .n {
  background: rgba(255,255,255,.22);
  color: #fff;
}
.wizard-steps li.done {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent-strong);
}
.wizard-steps li.done .n {
  background: var(--accent);
  color: #fff;
}

.step-heading {
  margin: 0 0 6px;
  font-size: 1.15rem;
}
.step-lead { margin: 0 0 14px; }
.step-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.step-actions .btn-primary { flex: 1; min-width: 140px; }

.identified-card {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: var(--accent-soft);
}
.identified-title {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.identified-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-strong);
}
.identified-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: .86rem;
  color: var(--muted);
}
.identified-note {
  margin: 10px 0 0;
  font-size: .82rem;
  color: var(--muted);
}

.inventory-panel {
  margin-top: 20px;
}
.inventory-inline {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.inventory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.inventory-head h2 { margin: 0; font-size: 1.05rem; }
.inventory-list,
.inventory-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inventory-row {
  display: grid;
  gap: 8px;
}
.inventory-row[data-cat='gpt'] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.inventory-row[data-cat='claude'] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.inventory-item {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  font-size: .88rem;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.inventory-item strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inventory-item span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .78rem;
  flex-shrink: 0;
}
.inventory-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}
.inventory-item.sold .dot { background: var(--danger); }
.inventory-item.sold { opacity: .72; }
.inventory-item.is-hit {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.inventory-item.is-hit strong { color: var(--accent-strong); }

@media (max-width: 900px) {
  .inventory-row[data-cat='gpt'],
  .inventory-row[data-cat='claude'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .inventory-row[data-cat='gpt'],
  .inventory-row[data-cat='claude'] {
    grid-template-columns: 1fr;
  }
}

#prefixHint {
  margin: -6px 0 12px;
  color: var(--accent-strong);
}

/* 手机端缩短动画，降低主线程压力 */
@media (max-width: 760px) {
  .fx-enter, .fx-pop, .fx-title, .fx-soft,
  .result.show, .account-preview, .modal, .modal-card {
    animation-duration: .16s !important;
  }
  .product:hover { transform: none; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-enter, .fx-pop, .fx-title, .fx-soft,
  .result.show, .account-preview, .modal, .modal-card,
  body, .panel, .hero, .brand-mark, .lang-switch, .btn, .product {
    transition: none !important;
    animation: none !important;
  }
  .miku-stage { animation: none !important; }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-direction: column; align-items: stretch; }
  .lang-switch { align-self: flex-start; }
  .miku-stage {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
  }
  .miku-figure {
    width: min(720px, 98vw);
    max-height: 90vh;
    opacity: .28;
  }
  .hero-copy { max-width: 100%; }
}
@media (max-width: 560px) {
  .wrap { width: min(100% - 20px, 1480px); padding-top: 18px; }
  .hero, .panel { padding: 18px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .products { grid-template-columns: 1fr 1fr; }
}
