/* Misaki Shop - Public Styles - Kawaii Pink Theme (Replicated from Next.js) */
:root {
  /* 字体 */
  --font-display: 'Baloo 2', 'Avenir Next', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --font-body: 'Nunito', 'Avenir Next', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  
  /* 主色 */
  --pink-500: #EC4899;
  --pink-600: #DB2777;
  
  /* 深紫文字 */
  --purple-900: #2E1065;
  --purple-800: #3D2B4F;
  
  /* 淡紫底 */
  --purple-100: #EFE8FD;
  
  /* 保留旧变量映射 */
  --rose-50: #fff7fa;
  --rose-100: #ffe7f0;
  --rose-200: #ffcadd;
  --rose-400: #f875a7;
  --rose-600: #cf2f6c;
  --cherry: #98244f;
  --cream: #fffdf5;
  --mint: #9ee6cf;
  --lemon: #ffe793;
  --blue: #b9dcff;
  --ink: #352331;
  --muted: #776471;
  --line: rgba(152, 36, 79, 0.14);
  --shadow: 0 24px 70px rgba(152, 36, 79, 0.14);
  
  /* 圆角 */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--rose-50); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 231, 147, 0.52), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(158, 230, 207, 0.4), transparent 24%),
    radial-gradient(circle at 74% 82%, rgba(185, 220, 255, 0.32), transparent 28%),
    linear-gradient(135deg, #fffafd 0%, #fff0f6 42%, #fffdf5 100%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.container {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
}

.prose {
  line-height: 1.75;
  color: var(--ink);
}

.prose h1, .prose h2, .prose h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-top: 1.4em;
}
.prose > :first-child { margin-top: 0; }

.prose a { color: var(--rose-600); font-weight: 800; }
.prose code {
  background: rgba(255, 112, 166, 0.15);
  border-radius: 6px;
  padding: 2px 6px;
}
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 12px auto;
}
.prose video, .prose iframe { max-width: 100%; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.95em;
}
.prose th, .prose td {
  border: 1px solid rgba(152, 36, 79, 0.14);
  padding: 8px 12px;
  text-align: left;
}
.prose th { background: rgba(255, 231, 240, 0.6); }
.prose blockquote {
  margin: 14px 0;
  padding: 10px 16px;
  border-left: 4px solid var(--rose-400, #f875a7);
  background: rgba(255, 231, 240, 0.4);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
}
.prose pre {
  overflow-x: auto;
  padding: 14px;
  border-radius: 12px;
  background: rgba(53, 35, 49, 0.92);
  color: #ffe7f0;
}
.prose pre code { background: none; padding: 0; }

/* ===== Shop Page ===== */
.shop-page {
  min-height: 100dvh;
  padding: clamp(16px, 3vw, 38px) 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1.12fr) minmax(500px, 0.88fr);
  grid-template-areas:
    "art right"
    "details right";
  column-gap: 22px;
  row-gap: 24px;
  align-items: start;
  align-content: start;
  min-height: min(840px, calc(100dvh - 72px));
}

/* Right column: checkout panel + optional notice card, fixed gap */
.hero-right {
  grid-area: right;
  display: grid;
  gap: 24px;
  align-content: start;
}

.hero-right .checkout-panel { grid-area: auto; }

.notice-card {
  width: min(100%, 560px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 36px);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 18px 54px rgba(46, 16, 101, 0.08);
  backdrop-filter: blur(18px);
}

.product-art {
  grid-area: art;
  position: relative;
  height: clamp(480px, 55vh, 620px);
  isolation: isolate;
}

.image-frame {
  position: absolute;
  inset: 0 10px 0 0;
  overflow: hidden;
  border: 8px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(255, 231, 147, 0.18)),
    var(--cream);
  box-shadow: 0 30px 90px rgba(46, 16, 101, 0.16);
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-art::before {
  content: "";
  position: absolute;
  inset: 0 90px 108px 42px;
  z-index: -1;
  border: 2px dashed rgba(152, 36, 79, 0.18);
  border-radius: 30px;
  transform: rotate(-2deg);
}

.product-art::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 16%;
  bottom: -14px;
  z-index: -2;
  height: 44px;
  border-radius: 999px;
  background: rgba(152, 36, 79, 0.14);
  filter: blur(28px);
}

.art-orbit {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
}

.art-orbit-mint {
  width: 132px;
  height: 132px;
  right: 0;
  top: 38px;
  background: rgba(158, 230, 207, 0.54);
}

.art-orbit-lemon {
  width: 108px;
  height: 108px;
  left: 26px;
  bottom: 44px;
  background: rgba(255, 231, 147, 0.64);
}

.art-caption {
  position: absolute;
  left: 40px;
  top: -14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  padding: 11px 15px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--cherry);
  box-shadow: 0 14px 34px rgba(152, 36, 79, 0.12);
  backdrop-filter: blur(14px);
  font-size: 0.92rem;
  font-weight: 900;
}

.sticker {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: rgba(255, 253, 245, 0.92);
  color: var(--cherry);
  box-shadow: 0 16px 38px rgba(152, 36, 79, 0.16);
  font-weight: 900;
  backdrop-filter: blur(14px);
}

.sticker-one {
  left: 44px;
  bottom: 32px;
  border-radius: 999px;
  padding: 13px 17px;
}

.sticker-two {
  right: 0;
  top: 120px;
  border-radius: 18px;
  padding: 14px 15px;
  transform: rotate(5deg);
}

@media (min-width: 1500px) {
  .hero-grid {
    grid-template-columns: minmax(700px, 1.18fr) minmax(580px, 0.82fr);
  }
  /* Higher specificity: this media block sits BEFORE the base .checkout-panel
     rule, so equal-specificity selectors here would lose to it. */
  .hero-right .checkout-panel,
  .hero-right .notice-card { width: min(100%, 610px); }
  .checkout-panel h1 {
    font-size: clamp(1rem, 2.00vw, 3rem);
  }
}

.checkout-panel {
  grid-area: checkout;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-lg);
  width: min(100%, 560px);
  padding: clamp(28px, 2.4vw, 40px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 253, 245, 0.64)),
    rgba(255, 255, 255, 0.68);
  box-shadow: 0 28px 90px rgba(46, 16, 101, 0.13);
  backdrop-filter: blur(20px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-full);
  padding: 9px 13px;
  background: #fff;
  color: var(--pink-600);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.checkout-panel h1 {
  margin: 18px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(30px, 2.00vw, 36px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
}

.short-copy {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  max-width: 42ch;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgba(46, 16, 101, 0.1);
  border-radius: var(--radius-full);
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.option-block { margin-top: 28px; }

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.label {
  display: block;
  margin-bottom: 10px;
  color: var(--cherry);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.field-hint {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.amount-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.amount-chip:hover, .amount-chip.active {
  transform: translateY(-2px);
  background: var(--cherry);
  color: #fff;
  box-shadow: 0 12px 26px rgba(152, 36, 79, 0.2);
}

.amount-chip:active { transform: translateY(0) scale(0.98); }

.custom-amount-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--cherry);
  font-family: var(--font-body);
  font-weight: 700;
}

.custom-amount-field span { font-size: 14px; }

.custom-amount-field input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
}

.custom-amount-field input:focus {
  outline: 3px solid rgba(248, 117, 167, 0.24);
  outline-offset: 1px;
}

.quantity-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-top: 22px;
  gap: 20px;
}

.stepper {
  display: grid;
  grid-template-columns: 44px 74px 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.stepper button, .stepper input {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
}

.stepper button {
  display: grid;
  place-items: center;
  background: rgba(255, 231, 240, 0.8);
}

.buyer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.buyer-grid label { color: var(--cherry); font-family: var(--font-body); font-weight: 700; }
.buyer-grid label span { display: block; font-size: 14px; }

.buyer-grid input {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-family: var(--font-body);
}

.buyer-grid input:focus, .stepper input:focus {
  outline: 3px solid rgba(248, 117, 167, 0.24);
  outline-offset: 1px;
}

.buyer-privacy-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.total-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 24px 0 16px;
  border: 1px solid rgba(46, 16, 101, 0.12);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background:
    linear-gradient(135deg, rgba(255, 231, 147, 0.34), rgba(255, 255, 255, 0.76)),
    #fff;
}

.total-card span { display: block; color: var(--muted); font-family: var(--font-body); font-weight: 600; }
.total-card strong span { color: var(--cherry); }
.total-card small { display: block; margin-top: 3px; color: var(--muted); font-family: var(--font-body); font-weight: 600; }

.total-card strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cherry);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  white-space: nowrap;
}

.paypal-box { min-height: 92px; overflow: visible; }
.paypal-box p { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }
.paypal-powered-by { bottom: 14px; }
.paypal-hint { border-left: 3px solid var(--rose-400); padding-left: 10px; }

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--cherry);
  color: #fff;
  box-shadow: 0 15px 30px rgba(46, 16, 101, 0.24);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.notice {
  margin-top: 14px;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: rgba(255, 232, 144, 0.45);
  color: var(--cherry);
  font-family: var(--font-body);
  font-weight: 600;
}

.support-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--pink-600);
  font-family: var(--font-body);
  font-weight: 700;
}

/* SVG icons in art elements */
.art-caption svg,
.sticker svg { flex-shrink: 0; }

.mobile-checkout-bar { display: none; }

.details-section {
  grid-area: details;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(22px, 3vw, 36px);
  margin-top: 0;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 36px);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 18px 54px rgba(46, 16, 101, 0.08);
  backdrop-filter: blur(18px);
}

.section-title span {
  color: var(--rose-600);
  font-weight: 1000;
  text-transform: uppercase;
}

.section-title h2 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 3vw, 3.35rem);
  line-height: 1;
}

/* Floating Widget styles live in /static/css/floating-widget.css (shared with official home) */

/* Article Page */
.article-page { max-width: 800px; margin: 0 auto; padding: 60px 20px; }
.article-page h1 { font-size: 2.2rem; color: var(--cherry); margin-bottom: 16px; }
.article-page .meta { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.article-page .article-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px; margin: -8px 0 32px; box-shadow: 0 12px 36px rgba(152, 36, 79, 0.12); }
.article-page .body { line-height: 1.9; color: var(--ink); }
.article-page .body h2 { margin: 24px 0 12px; color: var(--cherry); }
.article-page .body p { margin-bottom: 16px; }
.article-page .body img { max-width: 100%; border-radius: 12px; }

/* Error Page */
.error-page { text-align: center; padding: 100px 20px; }
.error-page h1 { font-size: 3rem; color: var(--rose-600); }
.error-page p { color: var(--muted); margin-top: 12px; }

/* Responsive */
@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "art" "checkout" "details";
  }
  .hero-grid.has-notice {
    grid-template-areas: "art" "checkout" "details" "notice";
  }
  .hero-right { display: contents; }
  .hero-right .checkout-panel { grid-area: checkout; }
  .notice-card { grid-area: notice; }
  .product-art { height: clamp(320px, 44vh, 520px); }
  .image-frame { inset: 0; }
  .details-section { grid-template-columns: 1fr; margin-top: 0; }
  .checkout-panel { width: 100%; }
  .notice-card { width: 100%; }
  .amount-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buyer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .shop-page {
    padding-top: 12px;
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  }

  .container { width: min(100% - 24px, 560px); }

  .hero-grid { gap: 14px; }

  .product-art { height: 238px; }
  .product-art::before { inset: 0 22px 18px 14px; border-radius: 24px; }
  .image-frame { inset: 16px 0 0; border-width: 6px; border-radius: 22px; }

  .art-caption { left: 18px; top: 0; padding: 9px 12px; font-size: 0.78rem; }
  .sticker-one { left: 18px; bottom: 10px; padding: 9px 12px; font-size: 0.78rem; }
  .sticker-two { right: 8px; top: 64px; padding: 9px 10px; font-size: 0.78rem; }

  .checkout-panel { padding: 18px; margin-bottom: 0; }
  .checkout-panel h1 { margin: 12px 0 8px; font-size: clamp(30px, 6vw, 36px); }
  .short-copy { margin: 0; font-size: 1rem; line-height: 1.45; }

  .trust-row { display: none; }

  .option-block { margin-top: 18px; }

  .amount-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .amount-chip { min-height: 44px; }

  .custom-amount-field { margin-top: 10px; }
  .custom-amount-field input { height: 46px; }

  .quantity-row {
    display: grid;
    gap: 8px;
    justify-content: stretch;
    margin-top: 16px;
  }
  .stepper { width: 100%; grid-template-columns: 48px minmax(0, 1fr) 48px; }

  .total-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin: 18px 0 12px;
    padding: 13px 14px;
  }
  .total-card strong { font-size: 24px; }

  .buyer-grid { gap: 10px; margin-top: 16px; }
  .buyer-grid input { height: 44px; }

  .paypal-box { min-height: 74px; }
  .support-link { margin-top: 10px; }

  /* Mobile checkout bar */
  .mobile-checkout-bar {
    --mobile-checkout-offset: 12px;
    --mobile-checkout-visual-bottom: 0px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(
      var(--mobile-checkout-offset) +
      env(safe-area-inset-bottom, 0px) +
      var(--mobile-checkout-visual-bottom)
    );
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(46, 16, 101, 0.14);
    border-radius: var(--radius-md);
    padding: 10px 10px 10px 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 46px rgba(46, 16, 101, 0.18);
    backdrop-filter: blur(18px);
  }
  .mobile-checkout-bar div { display: grid; gap: 2px; }
  .mobile-checkout-bar div > span { color: var(--muted); font-size: 0.76rem; font-weight: 900; }
  .mobile-checkout-bar strong { color: var(--cherry); font-size: 1.5rem; font-weight: 1000; line-height: 1; }
  .mobile-checkout-bar strong small { font-size: 0.72em; font-weight: 900; }
  #mobileTotalDisplay { color: inherit; font-size: inherit; font-weight: inherit; }
  .mobile-checkout-bar button {
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    background: var(--cherry);
    color: #fff;
    box-shadow: 0 12px 24px rgba(152, 36, 79, 0.2);
    font-weight: 1000;
  }

  /* Floating widget mobile offsets live in floating-widget.css
     (loaded after this file, so they must win there). */

  .details-section { gap: 14px; margin-top: 0; padding: 20px; }
}

/* ===== Product badge emoji ===== */
.badge-emoji {
  font-size: 1.1em;
  line-height: 1;
}

.badge-icon {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}
