/**
 * Pongrabbit / 彭兔子 — aligned with WeChat mini program app.wxss + pages/index + result.
 * rpx → px: ~750rpx = 375px ⇒ divide rpx by 2 for web approximation.
 */

:root {
  --bg-page: #f5f1eb;
  --bg-card: #fdfcfa;
  --bg-hero-start: #f0ebe2;
  --bg-hero-mid: #ede8df;
  --bg-hero-end: #f2ede4;
  --bg-muted: #faf8f3;
  --bg-canvas-area: #ebe6dc;
  --bg-sheet: #fffdfb;
  --ink: #23201c;
  --ink2: #8a8278;
  --gold: #b8924a;
  --gold-border: rgba(184, 146, 74, 0.18);
  --gold-line: rgba(184, 146, 74, 0.3);
  --hint: #b0a090;
  --err: #c0392b;
  --shadow-card: 0 2px 12px -4px rgba(80, 60, 30, 0.08);
  --shadow-card-hover: 0 4px 24px -4px rgba(35, 32, 28, 0.12);
  --radius-card: 10px;
  --radius-btn: 7px;
  --font: "PingFang SC", "Heiti SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body.page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.45;
}

.gold {
  color: var(--gold);
}
.ink2 {
  color: var(--ink2);
}

/* ── Hero（app.wxss）── */
.hero {
  background: linear-gradient(105deg, var(--bg-hero-start), var(--bg-hero-mid) 50%, var(--bg-hero-end));
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(184, 146, 74, 0.25);
}
.hero-studio {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hero-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
  margin: 0 0 4px;
}
.hero-sub {
  font-size: 13px;
  color: var(--ink2);
  margin: 0;
}

/* ── Card（index.wxss）── */
.card {
  background: var(--bg-card);
  margin: 8px 12px 0;
  border-radius: var(--radius-card);
  border: 1px solid var(--gold-border);
  padding: 12px 14px 12px;
  box-shadow: var(--shadow-card);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.card-bar {
  width: 3px;
  height: 15px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}

/* ── Guide button ── */
.btn-guide {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: transparent;
  border: 1px solid rgba(184, 146, 74, 0.4);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--ink2);
  margin-bottom: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  text-decoration: none;
  box-sizing: border-box;
}
a.btn-guide {
  color: var(--ink2);
}
.btn-guide:hover {
  background: rgba(184, 146, 74, 0.08);
}

/* ── Fields ── */
.field-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.field-item {
  width: calc(50% - 8px);
  min-width: 140px;
  flex: 1 1 calc(50% - 8px);
}
.field-item--full {
  width: 100%;
  flex: 1 1 100%;
}
.field-label {
  display: block;
  font-size: 11px;
  color: var(--ink2);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.field-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border-bottom: 2px solid rgba(184, 146, 74, 0.3);
  padding-bottom: 4px;
  transition: border-color 0.2s;
}
.field-row:focus-within {
  border-bottom-color: var(--gold);
}
.field-input {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  font-family: inherit;
}
.field-unit {
  font-size: 12px;
  color: var(--gold);
  flex-shrink: 0;
}
.field-err .field-label {
  color: var(--err);
  font-weight: 600;
}
.field-err .field-row {
  border-bottom-color: var(--err);
  border-bottom-width: 3px;
}
.dual {
  font-size: 11px;
  color: var(--hint);
  margin-top: 4px;
  min-height: 1.1em;
}

/* ── Options / radio chips（index.wxss）── */
.opt-section {
  margin-bottom: 12px;
}
.opt-section:last-child {
  margin-bottom: 0;
}
.opt-label {
  font-size: 12px;
  color: var(--ink2);
  margin-bottom: 6px;
  display: block;
}
.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.radio-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(184, 146, 74, 0.3);
  font-size: 13px;
  color: var(--ink2);
  background: var(--bg-card);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.radio-item:hover {
  border-color: rgba(184, 146, 74, 0.55);
}
.radio-sel {
  background: var(--ink);
  color: var(--bg-card);
  border-color: var(--ink);
}

/* ── Pattern select（原生 select 小程序化）── */
.select-wrap {
  margin-top: 4px;
}
.select-pattern {
  width: 100%;
  appearance: none;
  background: var(--bg-muted);
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  padding: 10px 36px 10px 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23B8924A' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.select-pattern:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(184, 146, 74, 0.2);
}

/* ── Primary button（btn-generate）── */
.btn-wrap {
  padding: 12px 12px 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.btn-generate {
  width: 100%;
  background: var(--ink);
  color: var(--bg-card);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  border-radius: var(--radius-btn);
  padding: 14px 0;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.btn-generate:hover:not(:disabled) {
  opacity: 0.88;
}
.btn-generate:active:not(:disabled) {
  opacity: 0.75;
}
.btn-generate:disabled,
.btn-generate--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.disclaimer {
  font-size: 11px;
  color: var(--hint);
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
  padding: 0 6px;
}

/* ── Checkout value prop（一次付费双 PDF）── */
.checkout-value-box {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  border: 1px solid var(--gold-line);
  background: linear-gradient(165deg, rgba(255, 252, 248, 0.98), rgba(250, 244, 232, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.checkout-value-lead {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}
.checkout-value-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink2);
}
.checkout-value-list li {
  margin-bottom: 6px;
}
.checkout-value-list li:last-child {
  margin-bottom: 0;
}
.checkout-value-foot {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink2);
}
.checkout-value-zh {
  display: inline;
  font-size: 12px;
  color: var(--hint);
}

/* ── Preview（result.wxss canvas-sheet / scroll）── */
.preview-section-label {
  font-size: 12px;
  font-weight: 600;
  color: #5a4d42;
  margin-bottom: 8px;
}
.preview-scroll {
  background: var(--bg-canvas-area);
  border-radius: var(--radius-card);
  border: 1px solid rgba(184, 146, 74, 0.15);
  overflow: auto;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
  max-height: min(92dvh, 960px);
  width: 100%;
  padding: 8px;
  position: relative;
}
.preview-sheet {
  display: inline-block;
  vertical-align: top;
  width: max-content;
  min-width: 100%;
  max-width: none;
  background: var(--bg-sheet);
  border: 1px solid rgba(35, 32, 28, 0.1);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(44, 40, 36, 0.07);
  position: relative;
}
.preview-inner {
  display: inline-block;
  vertical-align: top;
  width: max-content;
  max-width: none;
  line-height: 0;
}
.preview-inner svg,
.preview-sheet > svg {
  display: block;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  min-width: 0;
}
.watermark {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 800;
  color: rgba(184, 146, 74, 0.14);
  transform: rotate(-26deg);
  user-select: none;
}

/* ── Errors ── */
.err {
  color: var(--err);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.4;
}
.err-box {
  margin-top: 8px;
  padding: 12px 14px;
  background: #fff8f5;
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: 8px;
  font-size: 13px;
  color: #5a4d42;
}

/* ── Footer / legal ── */
.site-footer {
  padding: 16px 16px 24px;
  font-size: 12px;
  color: var(--ink2);
  text-align: center;
}
.site-footer a {
  color: var(--gold);
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}
.cookie-note {
  font-size: 11px;
  color: var(--hint);
  margin: 12px 12px 0;
  padding: 10px 12px;
  background: rgba(250, 245, 235, 0.9);
  border: 1px solid rgba(184, 146, 74, 0.22);
  border-radius: 8px;
  line-height: 1.5;
}
.cookie-note a {
  color: var(--gold);
}

/* ── Checkout email ── */
.email-row {
  border-bottom: 2px solid rgba(184, 146, 74, 0.3);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.email-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  padding: 4px 0;
}
.pay-msg {
  font-size: 12px;
  color: var(--ink2);
  margin-top: 8px;
  min-height: 1.2em;
}

/* Paddle Billing inline checkout mount (class name must match frameTarget in index.html) */
.paddle-inline-checkout {
  width: 100%;
  min-width: 312px;
  max-width: 100%;
  margin-top: 4px;
}
.paddle-inline-checkout--open {
  min-height: 200px;
}

code {
  font-size: 0.9em;
  background: rgba(184, 146, 74, 0.1);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: #5a4d42;
}

/* ── Legal / simple pages（与小程序同背景）── */
.doc-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 12px 32px;
}
.doc-card h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}
.doc-card h2 {
  font-size: 15px;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--ink);
}
.doc-card p,
.doc-card li {
  font-size: 14px;
  color: #5a4d42;
  line-height: 1.55;
}
.doc-card ul {
  padding-left: 1.2rem;
}
.doc-box {
  background: #faf5eb;
  border: 1px solid rgba(184, 146, 74, 0.28);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #5a4d42;
  margin: 12px 0;
  line-height: 1.5;
}
.doc-card a {
  color: var(--gold);
  text-decoration: none;
}
.doc-card a:hover {
  text-decoration: underline;
}
