:root {
  color-scheme: dark;
  --bg: #080e19;
  --bg-secondary: #101f36;
  --surface: #142136;
  --surface-hover: #1b2d49;
  --border: #2c405c;
  --primary: #3274c9;
  --primary-hover: #4185da;
  --text: #e7eef9;
  --text-secondary: #a5b6cf;
  --ink: var(--text);
  --muted: var(--text-secondary);
  --line: var(--border);
  --soft: var(--bg-secondary);
  --paper: var(--surface);
  --accent: #79b2fa;
  --accent-dark: #a5cdff;
  --accent-soft: #1c3453;
  --warm: #8abaff;
  --danger: #ffacb8;
  --danger-soft: #3a2231;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(48, 91, 153, 0.13), transparent 28rem),
    linear-gradient(155deg, var(--bg) 0%, var(--bg-secondary) 100%);
}

button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  width: min(1080px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-mark { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }

.secure-note { color: var(--muted); font-size: 0.86rem; }

main {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 44px 0 48px;
  flex: 1;
}

.hero { max-width: 650px; margin-bottom: 24px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 16px;
  font-size: clamp(1.65rem, 3.6vw, 2.65rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
  font-weight: 790;
}

.hero-copy, .section-copy {
  color: var(--muted);
  line-height: 1.7;
  font-size: clamp(.88rem, 1.5vw, .96rem);
}

.app-card {
  min-height: 340px;
  padding: clamp(24px, 5vw, 46px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  letter-spacing: -0.035em;
}

.section-copy { margin-bottom: 18px; }
.input-grid {
  display: grid;
  grid-template-columns: 1fr 36px 1fr;
  align-items: stretch;
}

.input-panel h3 { font-size: 0.94rem; margin-bottom: 13px; }
.input-divider {
  display: grid;
  place-items: center;
  color: #94a0aa;
  font-size: 0.82rem;
}

.drop-zone {
  min-height: 230px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  border: 1.5px dashed #aab8bf;
  border-radius: 18px;
  background: var(--soft);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.drop-zone span, .drop-zone small { color: var(--muted); }
.upload-symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 14px;
  color: var(--accent);
  background: var(--surface);
  font-size: 1.45rem;
  box-shadow: 0 8px 24px rgba(20, 50, 60, .09);
}

textarea {
  width: 100%;
  min-height: 174px;
  padding: 14px;
  resize: vertical;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  line-height: 1.5;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

textarea:focus { outline: 2px solid rgba(14, 118, 110, .28); border-color: var(--accent); }

.button {
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 720;
  text-decoration: none;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--primary); box-shadow: none; }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { margin-top: 10px; color: var(--accent-dark); background: var(--accent-soft); }
.full-width { width: 100%; }

.text-button {
  margin-top: 22px;
  padding: 4px 0;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.message { margin: 20px 0 0; padding: 13px 15px; border-radius: 12px; }
.message.error { color: var(--danger); background: var(--danger-soft); }

.product-summary {
  margin-bottom: 27px;
  padding: 20px;
  border-radius: 17px;
  background: var(--soft);
}

.details { margin: 0; }
.detail-row {
  padding: 9px 0;
  display: grid;
  grid-template-columns: minmax(110px, .55fr) 1.45fr;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); }
.detail-row dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }

.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.plan-card {
  position: relative;
  min-height: 210px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.plan-card:hover, .plan-card:focus-visible {
  outline: none;
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 15px 32px rgba(21, 52, 62, .1);
}
.plan-card.featured::after {
  content: "更划算";
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 5px 9px;
  color: #6a4810;
  background: #fff3d8;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
}
.plan-name { max-width: 75%; font-weight: 750; }
.plan-price { margin-top: 24px; font-size: 2rem; font-weight: 800; letter-spacing: -.04em; }
.plan-duration { margin-top: 4px; color: var(--muted); }
.plan-action { margin-top: auto; color: var(--accent); font-weight: 750; }

.empty-state, .pending-box {
  padding: 24px;
  border-radius: 17px;
  background: var(--soft);
}
.empty-state p, .pending-box p { margin: 6px 0 0; color: var(--muted); }

.pending-box {
  margin-top: 24px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--accent-soft);
}
.status-dot {
  width: 11px;
  height: 11px;
  margin-top: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 0 6px rgba(242, 184, 75, .18);
  animation: none;
}

.loading-row { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.success-mark, .error-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 1.7rem;
  font-weight: 850;
}
.success-mark { color: var(--accent); background: var(--accent-soft); }
.error-mark { color: var(--danger); background: var(--danger-soft); }
.download-button { width: 100%; margin-top: 24px; }

footer {
  padding: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: .78rem;
}
.footer-notes { display: flex; justify-content: space-between; gap: 7px; }
.icp-link { align-self: center; color: inherit; text-decoration: none; }
.icp-link:hover { color: var(--accent); text-decoration: underline; }
.icp-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.noscript { padding: 14px; color: var(--danger); background: var(--danger-soft); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }

@media (max-width: 680px) {
  .page-shell { width: min(100% - 24px, 560px); }
  .site-header { height: 64px; }
  .secure-note { display: none; }
  main { padding: 28px 0 32px; }
  h1 { font-size: clamp(1.55rem, 6.2vw, 1.9rem); }
  .app-card { padding: 23px 18px; border-radius: 21px; }
  .input-grid { grid-template-columns: 1fr; gap: 17px; }
  .input-divider { display: block; text-align: center; }
  .drop-zone { min-height: 142px; padding: 16px; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { min-height: 180px; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .footer-notes { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.button { max-width: 100%; white-space: normal; }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.payment-button { width: 100%; margin-top: 20px; }
.plan-card, .input-panel { min-width: 0; overflow-wrap: anywhere; }

.existing-license { margin: 20px 0; padding: 20px; border: 1px solid var(--border); border-radius: 16px; }
.existing-license h3 { font-size: 1.05rem; margin-bottom: 10px; }
.license-meta { color: var(--text-secondary); font-size: .82rem; margin: 12px 0 0; overflow-wrap: anywhere; }
.grant-list { list-style: none; padding: 0; margin: 14px 0; }
.grant-list li { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.grant-list span { font-size: .86rem; }
.grant-active { color: var(--text-secondary); }
.grant-expired { color: var(--danger); }
.license-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.license-actions .button { flex: 1 1 125px; margin: 0; padding: 10px 16px; }
.renewal-summary { margin-top: 20px; color: var(--accent); overflow-wrap: anywhere; }

.trial-offer { padding: clamp(1rem, 3vw, 1.5rem); margin-block: 1rem; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(135deg, var(--surface), var(--bg-secondary)); }
.trial-offer h3 { font-size: clamp(1.1rem, 3vw, 1.35rem); margin-top: 0; }
.trial-offer p { line-height: 1.6; }
.trial-remaining { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
