:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --navy: #0b1220;
  --ink: #122033;
  --muted: #5b6b80;
  --line: rgba(37, 99, 235, 0.16);
  --card: rgba(255, 255, 255, 0.86);
  --white: #ffffff;
  --bg: #f4f8ff;
  --shadow: 0 16px 40px rgba(29, 78, 216, 0.10);
  --radius: 22px;
  --ok: #059669;
  --bad: #dc2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #dbeafe 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #bfdbfe 0%, transparent 50%),
    var(--bg);
}

img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(244, 248, 255, 0.78);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--blue-500), var(--blue-700));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}
.nav-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  color: white;
  background: linear-gradient(180deg, var(--blue-500), var(--blue-700));
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.25);
}
.btn-ghost {
  background: white;
  color: var(--blue-700);
  border: 1px solid var(--line);
}
.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
}

/* Hero */
.hero {
  padding: 42px 0 18px;
}
.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #e8f1ff 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}
.kicker {
  color: var(--blue-700);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(28px, 6vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.hero p { color: var(--muted); max-width: 58ch; }
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  min-width: 110px;
}
.stat b { display: block; font-size: 20px; color: var(--blue-700); }
.stat span { font-size: 12px; color: var(--muted); }

/* Toolbar */
.toolbar {
  display: grid;
  gap: 12px;
  margin: 22px 0 18px;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}
.search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.chip.active {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  padding-bottom: 90px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 280px;
  animation: rise .45s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.thumb {
  height: 132px;
  background:
    linear-gradient(135deg, rgba(37,99,235,.18), rgba(191,219,254,.7)),
    repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(37,99,235,.06) 12px, rgba(37,99,235,.06) 24px);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--blue-700);
  font-weight: 800;
  font-size: 28px;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  cursor: pointer;
  color: #94a3b8;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.fav svg { width: 18px; height: 18px; fill: currentColor; }
.fav.on {
  color: #e11d48;
  background: #ffe4e6;
}
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tag {
  width: fit-content;
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-700);
  background: var(--blue-50);
  border-radius: 999px;
  padding: 4px 8px;
}
.card h3 { font-size: 18px; letter-spacing: -0.03em; }
.card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.meta { font-size: 12px; color: var(--muted); }
.react-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.react-btn {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.react-btn.liked { color: #e11d48; background: #fff1f2; border-color: #fecdd3; }
.card-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.card-actions .btn { flex: 1; justify-content: center; padding: 9px 10px; font-size: 13px; min-width: 30%; }

.comment-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  margin: 0 0 14px;
}
.comment-item {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.comment-item b { display: block; font-size: 13px; }
.comment-item p { color: var(--ink); font-size: 13px; margin-top: 3px; }
.comment-item span { color: var(--muted); font-size: 11px; }

.pay-grid { display: grid; gap: 10px; margin: 8px 0 14px; }
.pay-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #f8fbff;
  display: grid;
  gap: 8px;
}
.pay-card code {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.modal-wide { width: min(560px, 100%); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  background: white;
  border: 1px dashed var(--line);
  border-radius: 22px;
}

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 12px;
}
.modal-bg.open { display: flex; }
.modal {
  width: min(520px, 100%);
  background: white;
  border-radius: 24px 24px 16px 16px;
  padding: 18px;
  max-height: min(92vh, 760px);
  overflow: auto;
  animation: rise .3s ease;
}
.modal h2 { margin-bottom: 6px; }
.modal .hint { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.form { display: grid; gap: 10px; }
label { font-size: 12px; font-weight: 800; color: var(--blue-700); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px;
  background: #f8fbff;
  outline: none;
}
textarea { min-height: 84px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; gap: 8px; margin-top: 8px; }
.modal-actions .btn { flex: 1; justify-content: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: white;
  padding: 12px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  z-index: 70;
  transition: .25s ease;
  font-size: 14px;
  font-weight: 700;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

.fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  box-shadow: 0 14px 28px rgba(29, 78, 216, 0.35);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  display: inline-block;
}
.status-dot.live { background: #10b981; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0 28px;
}

@media (min-width: 720px) {
  .hero-card {
    grid-template-columns: 1.4fr .8fr;
    align-items: center;
    padding: 36px;
  }
  .modal-bg { align-items: center; }
  .modal { border-radius: 24px; }
  .fab { display: none; }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .brand span { font-size: 15px; }
}
