/* 李层层基金会 — crude doodle aesthetic (purple Leo-Scorpio edition) */

:root {
  --bg: #f3ebff;              /* soft lavender */
  --paper: #ffffff;
  --ink: #2a1b3d;             /* deep violet-black */
  --accent: #7c4dff;          /* primary purple */
  --accent-dark: #5b2ec2;     /* deeper purple for shadows */
  --accent-2: #ffd23f;        /* imperial gold */
  --accent-3: #ff6b9d;        /* pink kiss */
  --accent-4: #b388ff;        /* lavender glow */
  --soft: #ebe0ff;            /* very light purple */
  --shadow: 4px 4px 0 #2a1b3d;

  /* If you want to swap in a real photo (cat meme / blurred bouquet),
     set --bg-image to url("assets/your-file.jpg") and bump --bg-image-opacity. */
  --bg-image: none;
  --bg-image-opacity: 0.18;
}

* { box-sizing: border-box; }

:root { color-scheme: light; }
html, body { color-scheme: light; }

body {
  margin: 0;
  font-family: "Comic Sans MS", "Marker Felt", "Hiragino Maru Gothic ProN",
               "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 18% 22%, #d9c4ff 0, transparent 45%),
    radial-gradient(circle at 82% 74%, #ffd6ec 0, transparent 42%),
    radial-gradient(circle at 50% 96%, #c7b3ff 0, transparent 46%);
  color: var(--ink);
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Optional background photo layer — driven by --bg-image. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  opacity: var(--bg-image-opacity);
  filter: blur(14px) saturate(1.1);
  pointer-events: none;
  z-index: 0;
}

/* Subtle purple sparkle/paw pattern overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(124, 77, 255, 0.08) 0, transparent 3%),
    radial-gradient(circle at 28% 62%, rgba(255, 107, 157, 0.1) 0, transparent 3%),
    radial-gradient(circle at 72% 36%, rgba(124, 77, 255, 0.08) 0, transparent 3%),
    radial-gradient(circle at 88% 78%, rgba(179, 136, 255, 0.14) 0, transparent 3%),
    radial-gradient(circle at 44% 88%, rgba(255, 210, 63, 0.1) 0, transparent 3%);
  pointer-events: none;
  z-index: 0;
}

#app { position: relative; z-index: 1; }

#app {
  width: 100%;
  max-width: 680px;
}

.screen {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 34px 30px;
  position: relative;
}

/* tiny paw prints in the corner */
.screen::before {
  content: "🐾";
  position: absolute;
  top: -14px;
  right: 24px;
  font-size: 22px;
  transform: rotate(14deg);
  background: var(--accent-2);
  border: 2px solid var(--ink);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 var(--ink);
}

/* ─── Landing ─────────────────────────────────────────────── */
.landing { text-align: center; }

.badge {
  display: inline-block;
  background: var(--accent-2);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 16px;
  transform: rotate(-2deg);
}

.crown {
  font-size: 46px;
  margin-bottom: 4px;
  filter: drop-shadow(2px 2px 0 var(--ink));
}

.title {
  font-size: 52px;
  font-weight: 900;
  margin: 0 0 4px;
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--ink);
  letter-spacing: 2px;
}

.title .sub {
  display: block;
  font-size: 20px;
  color: var(--ink);
  text-shadow: none;
  margin-top: 8px;
  letter-spacing: 0;
}

.mascot-box {
  width: 180px;
  height: 180px;
  margin: 18px auto 10px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 4px var(--accent-2) inset;
  background: #fff;
  position: relative;
}

.mascot-box::after {
  content: "👑";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-6deg);
  font-size: 28px;
  filter: drop-shadow(1px 2px 0 var(--ink));
  pointer-events: none;
}

.mascot-box svg,
.mascot-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tagline {
  font-size: 16px;
  line-height: 1.75;
  margin: 18px 0;
  color: #444;
}

.warn {
  background: #fff3cd;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  margin: 20px 0;
  line-height: 1.6;
  transform: rotate(-0.5deg);
}

.btn-big {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 16px 36px;
  font-size: 22px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
  margin: 16px 0 12px;
}

.btn-big:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.btn-big:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.footnote {
  font-size: 12px;
  color: #888;
  margin-top: 20px;
  line-height: 1.5;
}

/* ─── Survey ──────────────────────────────────────────────── */
.survey { padding-top: 22px; }

.survey-head {
  text-align: center;
  margin-bottom: 22px;
}

.survey-title {
  font-size: 26px;
  margin: 0 0 6px;
  color: var(--accent);
  text-shadow: 2px 2px 0 var(--ink);
}

.survey-sub {
  font-size: 14px;
  color: #666;
}

.section {
  margin-bottom: 26px;
}

.section-label {
  display: inline-block;
  font-size: 15px;
  font-weight: bold;
  background: var(--accent-4);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 4px 12px;
  margin-bottom: 12px;
  transform: rotate(-0.7deg);
}

.section-hint {
  font-size: 12px;
  color: #888;
  margin-left: 8px;
  font-weight: normal;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 12px 12px;
  text-align: left;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1.3;
}

.chip:hover {
  background: var(--soft);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.chip.selected {
  background: #ece0ff;
  border-color: var(--accent);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--accent);
}

.chip-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-weight: bold;
  flex-shrink: 0;
  font-size: 12px;
  color: transparent;
  line-height: 1;
}

.chip.selected .chip-tick {
  background: var(--accent);
  color: #fff;
}

.chip-name {
  flex: 1;
  line-height: 1.35;
}

.chip-en {
  font-size: 10px;
  color: #999;
  display: block;
}

.other-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  outline: none;
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.other-input:focus {
  background: #fffbe8;
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-submit {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 16px;
  font-size: 20px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.1s;
  margin-top: 8px;
}

.btn-submit:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.btn-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: 2px 2px 0 #888;
}

.selection-hint {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin: 6px 0 10px;
}

/* ─── Add-to-cart button ─────────────────────────────────── */
.btn-add {
  display: block;
  width: 100%;
  background: var(--accent-4);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 14px;
  font-size: 17px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.12s;
  margin: 4px 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-add:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--accent);
}

.btn-add:disabled {
  background: #d6cce8;
  color: #fff;
  cursor: not-allowed;
  box-shadow: 2px 2px 0 #888;
  border-color: #888;
}

.btn-add .add-cost {
  font-size: 12px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

@keyframes pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.04); background: var(--accent-3); }
  100% { transform: scale(1); }
}

.btn-add.pulse { animation: pulse 0.3s; }

/* ─── Cart list ──────────────────────────────────────────── */
.cart-section { margin-bottom: 22px; }

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-empty {
  text-align: center;
  font-size: 14px;
  color: #999;
  font-style: italic;
  padding: 18px 10px;
  background: var(--soft);
  border: 2px dashed var(--ink);
  border-radius: 10px;
  margin: 0;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  box-shadow: 3px 3px 0 var(--ink);
  animation: cart-in 0.2s ease-out;
}

@keyframes cart-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cart-item-n {
  font-size: 12px;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.cart-item-pair {
  flex: 1;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cart-item-cat {
  color: var(--accent-dark);
  font-weight: bold;
}

.cart-item-sep { color: #aaa; }

.cart-item-brand {
  color: var(--accent-3);
  font-weight: bold;
}

.cart-item-cost {
  font-size: 12px;
  color: #888;
  font-family: "SF Mono", "Menlo", monospace;
  flex-shrink: 0;
}

.cart-item-remove {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  font-family: inherit;
  color: var(--ink);
  padding: 0;
  flex-shrink: 0;
  transition: all 0.1s;
}

.cart-item-remove:hover {
  background: #ffd6e0;
  color: #d4504e;
  border-color: #d4504e;
}

/* ─── Receipt / Thanks ───────────────────────────────────── */
.receipt { text-align: center; }

.receipt-stamp {
  display: inline-block;
  border: 3px solid var(--accent);
  color: var(--accent);
  border-radius: 12px;
  padding: 6px 18px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
  transform: rotate(-4deg);
  margin-bottom: 12px;
  background: rgba(255,107,157,0.06);
}

.receipt-title {
  font-size: 30px;
  margin: 10px 0 6px;
  color: var(--accent);
  text-shadow: 2px 2px 0 var(--ink);
}

.imperial-decree {
  background: var(--soft);
  border: 2px dashed var(--ink);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 18px 0;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink);
  transform: rotate(-0.4deg);
}

.imperial-decree .scroll-mark {
  display: block;
  font-size: 12px;
  letter-spacing: 3px;
  color: #888;
  margin-bottom: 6px;
}

.summary {
  text-align: left;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.8;
}

.summary h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--accent);
}

.summary ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.summary li { margin-bottom: 2px; }

.summary .none { color: #999; font-style: italic; }

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn-share, .btn-restart {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: all 0.1s;
}

.btn-share:hover, .btn-restart:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn-share { background: var(--accent-2); }

/* ─── Verification (shared with SDTI) ─────────────────────── */
.verify { text-align: center; }

.verify-question {
  font-size: 22px;
  line-height: 1.75;
  margin: 24px 0;
  color: var(--ink);
}

.verify-name {
  display: inline-block;
  background: linear-gradient(180deg, transparent 60%, #d9c4ff 60%);
  padding: 0 6px;
  font-size: 19px;
  color: var(--accent-dark);
  font-weight: bold;
  margin: 8px 0;
  line-height: 1.5;
}

.verify-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}

.btn-yes, .btn-no {
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 17px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.1s;
}

.btn-yes { background: #d9c4ff; color: var(--ink); }
.btn-no  { background: #e0e0e0; color: var(--ink); }

.btn-yes:hover, .btn-no:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.key-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  margin: 18px 0 10px;
  outline: none;
  letter-spacing: 1px;
  text-align: center;
}

.key-input:focus {
  background: #fffbe8;
  box-shadow: var(--shadow);
}

.key-input.shake {
  animation: shake 0.4s;
  border-color: #d4504e;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.key-error {
  color: #d4504e;
  font-size: 14px;
  min-height: 22px;
  margin-bottom: 10px;
}

.key-hint {
  font-size: 12px;
  color: #aaa;
  margin-top: 6px;
}

/* ─── Decode animation ────────────────────────────────────── */
.decode-screen { padding: 36px 28px; }

.decode-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: #888;
  margin-top: 14px;
  font-family: "SF Mono", "Menlo", monospace;
}

.decode-line {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 20px;
  letter-spacing: 2px;
  padding: 14px 12px;
  margin: 6px 0;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  background: #fffbe8;
  word-break: break-all;
  text-align: center;
  min-height: 28px;
  transition: opacity 0.6s;
}

.decode-line.encoded { color: #888; }
.decode-line.encoded.faded { opacity: 0.25; }
.decode-line.decoded {
  color: var(--accent-dark);
  font-weight: bold;
  background: #f3ebff;
  border-color: var(--accent);
}

.decode-arrow {
  font-size: 32px;
  color: var(--accent);
  margin: 4px 0;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.decode-status {
  margin-top: 18px;
  font-size: 15px;
  color: #888;
  font-weight: bold;
}

.decode-status.success {
  color: #2d8f4e;
  font-size: 18px;
}

/* ─── Rejected ────────────────────────────────────────────── */
.rejected { text-align: center; padding: 50px 28px; }

.big-emoji {
  font-size: 80px;
  margin-bottom: 16px;
}

.reject-text {
  font-size: 28px;
  color: #d4504e;
  text-shadow: 2px 2px 0 var(--ink);
  margin: 14px 0;
  line-height: 1.6;
}

.reject-sub {
  font-size: 14px;
  color: #888;
  margin-top: 22px;
}

/* ─── Balance card (猫粮点数) ─────────────────────────────── */
.balance-card {
  background: linear-gradient(135deg, #7c4dff 0%, #b388ff 50%, #ff6b9d 100%);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 22px 0 18px;
  box-shadow: var(--shadow);
  color: #fff;
  text-align: left;
  position: relative;
  transform: rotate(-0.4deg);
}

.balance-card::after {
  content: "💜";
  position: absolute;
  top: -12px;
  left: -12px;
  font-size: 24px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 var(--ink);
}

.balance-label {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.85;
  text-transform: uppercase;
  font-weight: bold;
}

.balance-amount {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 1px;
  margin: 4px 0 2px;
  text-shadow: 2px 2px 0 var(--accent-dark);
  line-height: 1.05;
}

.balance-amount .unit {
  font-size: 16px;
  font-weight: bold;
  margin-left: 6px;
  letter-spacing: 0;
}

.balance-source {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 4px;
  font-style: italic;
}

/* Live ticker shown on the survey screen */
.balance-ticker {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.balance-ticker .ticker-label {
  color: #666;
  font-weight: bold;
}

.balance-ticker .ticker-value {
  color: var(--accent);
  font-weight: 900;
  font-size: 18px;
}

.balance-ticker.overdraft .ticker-value { color: #d4504e; }

.balance-ticker .ticker-cost {
  color: var(--accent-3);
  font-weight: bold;
}

/* Receipt balance block */
.balance-recap {
  background: var(--soft);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0 8px;
  font-size: 14px;
  line-height: 1.8;
  text-align: left;
}

.balance-recap .recap-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.balance-recap .recap-row.total {
  border-top: 2px dashed var(--ink);
  margin-top: 6px;
  padding-top: 6px;
  font-weight: 900;
  color: var(--accent-dark);
  font-size: 16px;
}

.balance-recap .overdraft-note {
  color: #d4504e;
  font-weight: bold;
  text-align: center;
  margin-top: 6px;
}

/* ─── Sponsor / beneficiary footer ────────────────────────── */
.sponsor-footer {
  text-align: center;
  font-size: 11px;
  color: #7a6b8a;
  line-height: 1.8;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #c9b8e8;
  font-style: italic;
  letter-spacing: 0.3px;
}

.sponsor-footer .sponsor-line { display: block; }
.sponsor-footer .beneficiary-line { display: block; }

/* ─── Mobile ──────────────────────────────────────────────── */
@media (max-width: 520px) {
  .screen { padding: 26px 20px; }
  .title { font-size: 40px; }
  .title .sub { font-size: 17px; }
  .mascot-box { width: 150px; height: 150px; }
  .survey-title { font-size: 22px; }
  .chip-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .chip { font-size: 13px; padding: 10px; }
  .imperial-decree { font-size: 15px; }
  .receipt-title { font-size: 24px; }
  .balance-amount { font-size: 34px; }
}
