:root {
  --bg: #f7f8fa;
  --fg: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --green: #15803d;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 18px; }

a { color: var(--accent); text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--fg); font-size: 16px; }
.logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
}
.nav { display: flex; gap: 20px; font-size: 14px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--fg); }

/* ---------- Hero ---------- */
.hero { padding: 46px 0 26px; text-align: center; }
.hero h1 { font-size: 32px; margin: 0 0 12px; letter-spacing: -.5px; }
.hero p { margin: 0 auto; max-width: 620px; color: var(--muted); }
.hero strong { color: var(--fg); font-weight: 600; }

/* ---------- Tool ---------- */
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}

.dropzone {
  border: 2px dashed #cfd6e0;
  border-radius: 12px;
  padding: 42px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dz-icon { font-size: 26px; color: var(--accent); line-height: 1; margin-bottom: 10px; }
.dz-title { font-weight: 600; margin-bottom: 6px; }
.dz-hint { color: var(--muted); font-size: 13px; }

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 18px 4px 4px;
  align-items: flex-end;
}
.field { flex: 1; min-width: 150px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: #374151; }
.field label span { color: var(--accent); font-weight: 600; }

select, input[type=text] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
}
select:disabled, input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

input[type=range] { width: 100%; accent-color: var(--accent); cursor: pointer; }
input[type=range]:disabled { opacity: .45; cursor: not-allowed; }

.pro-tag {
  display: inline-block;
  background: #dcfce7;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
}

/* ---------- Results ---------- */
.results { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--muted);
}
.results-head strong { color: var(--fg); }

.result-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfcfd;
}
.thumb {
  width: 46px; height: 46px;
  object-fit: cover;
  border-radius: 7px;
  background: #eef0f3;
  flex-shrink: 0;
}
.meta { flex: 1; min-width: 0; }
.name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sizes { font-size: 13px; color: var(--muted); }
.dims { font-size: 12px; }
.save { color: var(--green); font-weight: 600; }
.grow { color: #b45309; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-ghost { background: #eef2f7; color: var(--fg); }
.btn-ghost:hover:not(:disabled) { background: #e2e8f0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Pricing ---------- */
.pricing {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 38px 0;
}
.price-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
}
.price-card.featured { border-color: var(--accent); box-shadow: 0 6px 24px rgba(37,99,235,.12); }
.ribbon {
  position: absolute; top: -11px; right: 18px;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 3px 11px; border-radius: 99px;
}
.price-card h2 { font-size: 16px; margin: 0 0 10px; }
.price { font-size: 34px; font-weight: 700; letter-spacing: -1px; margin-bottom: 14px; }
.price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.price-card ul { list-style: none; padding: 0; margin: 0 0 20px; flex: 1; }
.price-card li {
  padding: 5px 0 5px 24px;
  position: relative;
  font-size: 14px;
  color: #374151;
}
.price-card li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--green);
  font-weight: 700;
}

/* ---------- Redeem ---------- */
.redeem-card, .buy-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  margin-bottom: 20px;
}
.redeem-card h2, .buy-card h2 { font-size: 17px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.redeem-form { display: flex; gap: 10px; margin-top: 14px; }
.redeem-form input {
  flex: 1;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.msg { margin: 12px 0 0; padding: 9px 13px; border-radius: 8px; font-size: 14px; }
.msg.ok { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; }
.msg.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.pro-status {
  margin-top: 12px; padding: 10px 14px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
}
.pro-status.on { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; }

/* ---------- Buy ---------- */
.buy-grid { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: start; margin-top: 10px; }
.pay-qr { width: 180px; border-radius: 10px; border: 1px solid var(--line); }
.qr-placeholder {
  width: 180px; height: 180px;
  border: 2px dashed #cfd6e0; border-radius: 10px;
  display: grid; place-items: center;
  text-align: center; color: var(--muted); font-size: 13px;
}
.contact p { margin: 0 0 6px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding: 22px 0 34px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .hero { padding: 32px 0 20px; }
  .hero h1 { font-size: 25px; }
  .pricing { grid-template-columns: 1fr; }
  .buy-grid { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
  .redeem-form { flex-direction: column; }
  .settings { gap: 14px; }
}