/* Catsia 全站統一回饋視覺系統 v1.0 */
:root {
  --catsia-feedback-z: 100500;
  --catsia-feedback-ink: #f8fafc;
  --catsia-feedback-muted: #aab5c6;
  --catsia-feedback-panel: #111827;
}

#catsia-feedback-root {
  position: fixed;
  inset: 0;
  z-index: var(--catsia-feedback-z);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 18, .68);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
#catsia-feedback-root.is-visible { opacity: 1; visibility: visible; }
#catsia-feedback-root[hidden] { display: none !important; }

.cf-card {
  --cf-accent: #34d399;
  --cf-soft: rgba(16, 185, 129, .13);
  --cf-border: rgba(52, 211, 153, .35);
  position: relative;
  width: min(100%, 510px);
  max-height: min(88dvh, 820px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255,255,255,.14);
  border-top: 3px solid var(--cf-accent);
  border-radius: 26px;
  padding: 24px;
  color: var(--catsia-feedback-ink);
  background: linear-gradient(155deg, rgba(22, 29, 47, .99), rgba(9, 14, 27, .99));
  box-shadow: 0 30px 90px rgba(0,0,0,.56), 0 0 42px var(--cf-soft), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateY(12px) scale(.985);
  transition: transform .22s cubic-bezier(.2,.75,.25,1);
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,.35) transparent;
}
#catsia-feedback-root.is-visible .cf-card { transform: translateY(0) scale(1); }
.cf-card[data-type="error"] { --cf-accent:#fb7185; --cf-soft:rgba(244,63,94,.13); --cf-border:rgba(251,113,133,.34); }
.cf-card[data-type="warning"] { --cf-accent:#fbbf24; --cf-soft:rgba(245,158,11,.13); --cf-border:rgba(251,191,36,.34); }
.cf-card[data-type="info"] { --cf-accent:#60a5fa; --cf-soft:rgba(59,130,246,.13); --cf-border:rgba(96,165,250,.34); }
.cf-card[data-type="payment"] { --cf-accent:#60a5fa; --cf-soft:rgba(59,130,246,.15); --cf-border:rgba(96,165,250,.36); }
.cf-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: #dbe4f0;
  font-size: 16px;
  cursor: pointer;
}
.cf-close:hover { background: rgba(255,255,255,.14); }
.cf-heading { display:flex; align-items:center; gap:14px; padding-right:36px; }
.cf-icon {
  display:grid; place-items:center; flex:0 0 58px; width:58px; height:58px;
  border-radius:19px; color:var(--cf-accent); background:var(--cf-soft);
  border:1px solid var(--cf-border); font-size:29px; font-weight:900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.cf-kicker {
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px;
  border:1px solid var(--cf-border); border-radius:999px; color:var(--cf-accent);
  background:var(--cf-soft); font-size:10px; font-weight:900; letter-spacing:.1em;
}
.cf-title { margin:7px 0 0; color:#fff; font-size:21px; font-weight:900; line-height:1.35; letter-spacing:.01em; }
.cf-message { margin:18px 0 0; color:#e2e8f0; font-size:14px; line-height:1.8; overflow-wrap:anywhere; }
.cf-section { margin-top:14px; padding:13px 14px; border:1px solid rgba(255,255,255,.1); border-radius:17px; background:rgba(2,6,23,.34); }
.cf-section-title { margin:0 0 9px; color:#cbd5e1; font-size:11px; font-weight:900; letter-spacing:.06em; }
.cf-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.cf-detail { min-width:0; padding:10px 11px; border:1px solid rgba(255,255,255,.08); border-radius:13px; background:rgba(255,255,255,.035); }
.cf-detail-label { display:block; margin-bottom:4px; color:#94a3b8; font-size:10px; font-weight:800; }
.cf-detail-value { display:block; color:#f8fafc; font-size:13px; font-weight:900; overflow-wrap:anywhere; }
.cf-detail-value.is-accent { color:var(--cf-accent); }
.cf-guidance { margin-top:13px; padding:12px 14px; border-left:3px solid var(--cf-accent); border-radius:0 13px 13px 0; background:var(--cf-soft); }
.cf-guidance strong { display:block; margin-bottom:4px; color:var(--cf-accent); font-size:11px; }
.cf-guidance p { margin:0; color:#e5e7eb; font-size:12px; line-height:1.7; }
.cf-actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:19px; }
.cf-action {
  display:inline-flex; flex:1 1 auto; min-width:110px; align-items:center; justify-content:center;
  min-height:44px; padding:10px 14px; border-radius:13px; border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.07); color:#e5e7eb; font-size:12px; font-weight:900;
  text-align:center; text-decoration:none; cursor:pointer; transition:filter .15s ease, transform .15s ease;
}
.cf-action:hover { filter:brightness(1.13); }
.cf-action:active { transform:scale(.98); }
.cf-action-primary { border-color:transparent; background:linear-gradient(135deg,var(--cf-accent),color-mix(in srgb,var(--cf-accent),#7c3aed 18%)); color:#07111f; }
.cf-footnote { margin:13px 0 0; color:#718096; font-size:10px; line-height:1.6; }
.cf-status-pill { display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border-radius:999px; color:var(--cf-accent); background:var(--cf-soft); border:1px solid var(--cf-border); font-size:10px; font-weight:900; }
.cf-card[data-type="payment"] .cf-detail:first-child .cf-detail-value { color:#93c5fd; }

/* SweetAlert2 retains its forms and validation behaviour, but shares the same visual language. */
.swal2-popup {
  width:min(560px, calc(100vw - 32px)) !important;
  max-height:min(90dvh, 860px) !important;
  overflow-y:auto !important;
  border:1px solid rgba(212,175,55,.28) !important;
  border-radius:24px !important;
  background:linear-gradient(155deg,#171d30,#0b1020) !important;
  color:#f8fafc !important;
  box-shadow:0 28px 80px rgba(0,0,0,.6) !important;
}
.swal2-title { color:#f8fafc !important; }
.swal2-html-container { color:#dbe4f0 !important; }
.swal2-actions button { min-height:44px !important; border-radius:12px !important; font-weight:800 !important; }

@media (max-width: 640px) {
  #catsia-feedback-root { align-items:flex-end; justify-content:center; padding:0; background:rgba(2,6,23,.58); }
  .cf-card {
    width:100%; max-width:none; max-height:min(86dvh, 760px);
    padding:22px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius:25px 25px 0 0; border-left:0; border-right:0; border-bottom:0;
    transform:translateY(30px);
  }
  #catsia-feedback-root.is-visible .cf-card { transform:translateY(0); }
  .cf-card[data-fullscreen-mobile="true"] { height:100dvh; max-height:100dvh; border-radius:0; padding-top:calc(24px + env(safe-area-inset-top)); }
  .cf-title { font-size:19px; }
  .cf-message { font-size:13px; }
  .cf-actions { display:grid; grid-template-columns:1fr; }
  .cf-action { width:100%; min-height:46px; }
  .cf-close { top:12px; right:12px; }
  .swal2-popup { width:calc(100vw - 18px) !important; max-height:88dvh !important; padding:18px 14px !important; border-radius:20px !important; }
  .swal2-title { font-size:18px !important; line-height:1.35 !important; }
  .swal2-html-container { max-height:58dvh !important; margin:.65rem 0 !important; font-size:13px !important; }
  .swal2-actions { width:100%; gap:8px !important; }
  .swal2-actions button { flex:1 1 0; min-height:46px !important; margin:0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  #catsia-feedback-root, .cf-card, .cf-action { transition:none !important; }
}
