/* ============================================================
   大梅沙垃圾图鉴 · Design System
   Brand: 轻扫行动社
   Colors: sand #EAE2D0 · ocean #4EC6E8 · brand-blue #3BAFD9
           brand-orange #F05A28 · ink #2C2416
   ============================================================ */

/* ─── Custom Fonts ──────────────────────────────────────────── */
@font-face {
  font-family: 'SweiFistLeg';
  src: url('../assets/fonts/SweiFistLegCJKjp-Bold-2.ttf') format('truetype');
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: 'SweiFistLeg';
  src: url('../assets/fonts/SweiFistLegCJKjp-Regular-2.ttf') format('truetype');
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: 'Paris2024';
  src: url('../assets/fonts/Paris2024-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'SweiFistLeg', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #2C2416;
  background: #EAE2D0;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --sand:        #EAE2D0;
  --sand-dark:   #D6CBBA;
  --sand-light:  #F5F0E8;
  --ocean:       #55cdf2;
  --ocean-mid:   #55cdf2;
  --ocean-deep:  #55cdf2;
  --brand-blue:  #55cdf2;
  --brand-orange:#F05A28;
  --ink:         #2C2416;
  --ink-mid:     #6B5F52;
  --ink-light:   #9E9082;
  --white:       #FFFFFF;
  --card-shadow: 0 4px 20px rgba(44,36,22,0.10);
  --radius:      16px;
  --radius-sm:   10px;
}

/* ─── Utility ───────────────────────────────────────────────── */
.sand-bg  { background: var(--sand); }
.white-bg { background: var(--white); }

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-title {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}
.section-sub {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-mid);
}

/* ─── HERO ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  min-height: 100svh;
  background: linear-gradient(
    to bottom,
    #6FCDE8  0%,
    #A8DEF0  10%,
    #D4EEFA  20%,
    #ffffff  33%,
    #ffffff  67%,
    #D4EEFA  80%,
    #A8DEF0  90%,
    #6FCDE8  100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  gap: clamp(2rem, 5vh, 5.5rem);
  padding-top: 0;
  padding-bottom: 5rem;
}

/* Top bar */
.hero-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  padding: 1.25rem 2rem;
  z-index: 10;
}
.hero-logo { display: flex; align-items: center; gap: 0.5rem; }
.hero-logo-img { height: 52px; width: auto; object-fit: contain; }

/* Center title */
.hero-title {
  position: relative;
  z-index: 5;
  text-align: center;
  user-select: none;
  pointer-events: none;
  flex-shrink: 0;
}
.hero-watermark {
  font-family: 'Paris2024', sans-serif;
  font-weight: 800;
  font-size: clamp(1.75rem, 6.25vw, 6.9rem);
  color: #e8edef;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  margin-bottom: 0.15em;
}
.hero-zh {
  font-size: clamp(2.8rem, 10vw, 11rem);
  font-weight: 700;
  color: #55cdf2;
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.hero-zh-ghost {
  color: #e8edef;
}

/* Nav pill */
.hero-scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  animation: arrow-bounce 2s ease-in-out infinite;
}
.hero-scroll-arrow:hover { opacity: 0.7; }
@keyframes arrow-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

.hero-nav {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  gap: 0.5rem;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 100px;
  padding: 0.4rem 0.5rem;
}
.nav-link {
  padding: 0.45rem 1.25rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-link:hover {
  background: rgba(85,205,242,0.15);
  color: var(--ink);
}
.nav-link.active {
  background: #55cdf2;
  color: #ffffff;
}

/* Sticky nav (when scrolled past hero) */
.site-nav-sticky {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.site-nav-sticky.visible { transform: translateY(0); }
.sticky-logo { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 1rem; color: var(--ink); }
.sticky-logo img { height: 32px; }
.sticky-links { display: flex; gap: 0.25rem; flex-shrink: 0; }
.sticky-links a { padding: 0.35rem 1rem; border-radius: 100px; font-size: 0.85rem; font-weight: 700; color: var(--ink-mid); transition: background 0.2s, color 0.2s; white-space: nowrap; }
.sticky-links a:hover { background: var(--sand-dark); color: var(--ink); }

/* ─── MARQUEE STRIPS ─────────────────────────────────────────── */
.marquee-strip {
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}
.marquee-track {
  display: flex;
  align-items: center;
  /* No gap — use margin-right on each item so total width = 24×(item+margin)
     This makes translateX(-50%) land exactly on the seam with zero jump. */
  padding: 0.75rem 0;
  width: max-content;
  will-change: transform;
}
.mq-item {
  height: clamp(100px, 14vw, 175px);
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.12));
  margin-right: clamp(4rem, 8vw, 11rem);
}
/* LTR: items move from left to right */
.marquee-ltr { animation: marqueeLTR 55s linear infinite; }
/* RTL: items move from right to left */
.marquee-rtl { animation: marqueeRTL 55s linear infinite; }
@keyframes marqueeLTR {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0%); }
}
@keyframes marqueeRTL {
  from { transform: translateX(0%); }
  to   { transform: translateX(-50%); }
}
.marquee-strip:hover .marquee-track { animation-play-state: paused; }

/* ─── STATS ─────────────────────────────────────────────────── */
.stats-section {
  background: #47c3ea;
  padding: 2rem 1.5rem;
}
.stats-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.stat {
  flex: 1;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
}
.stat-num {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}
.stat-num small { font-size: 0.6em; font-weight: 700; margin-left: 2px; }
.stat-text { font-size: clamp(1rem, 2.5vw, 1.5rem); }
.stat-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.stat-divider {
  width: 2.5px;
  height: 40px;
  background: rgba(255,255,255,0.8);
  flex-shrink: 0;
  border-radius: 2px;
}

/* ─── GALLERY ───────────────────────────────────────────────── */
.gallery-section {
  padding: 4rem 1.5rem 5rem;
  background: #F2F7FB;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.75rem;
}
.filter-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-mid);
  background: var(--white);
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-btn:hover {
  background: #bbebfa;
  color: var(--brand-blue);
}
.filter-btn.active {
  background: var(--brand-blue);
  color: var(--white);
}

.gallery-count {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
  min-height: 1.2em;
}

/* Card grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── TRASH CARD ────────────────────────────────────────────── */
.trash-card {
  background: #e8edef;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.trash-card:hover {
  background: #55cdf2;
  transform: translateY(-2px);
}

.card-photo-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.card-photo {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.trash-card:hover .card-photo { transform: scale(1.08); }

.card-category-badge {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: var(--brand-blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  letter-spacing: 0.03em;
}

.card-num {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--white);
  background: rgba(44,36,22,0.35);
  backdrop-filter: blur(4px);
  padding: 0.18rem 0.5rem;
  border-radius: 100px;
  letter-spacing: 0.08em;
  font-family: 'Courier New', monospace;
}

.card-body {
  padding: 1rem 1.1rem 1.25rem;
}
.card-name {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 0.2rem;
}
.card-latin {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--ink-light);
  font-family: 'Courier New', monospace;
  margin-bottom: 0.75rem;
}
.card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}
.card-meta-row {
  font-size: 0.78rem;
  color: var(--ink-mid);
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
}
.card-meta-icon { flex-shrink: 0; }

.card-danger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.card-danger-label {
  font-size: 0.72rem;
  color: var(--ink-light);
}
.danger-stars { color: #F05A28; font-size: 0.85rem; letter-spacing: 0.05em; }

.card-desc-preview {
  font-size: 0.8rem;
  color: var(--ink-mid);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.9rem;
}

.btn-detail {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-blue);
  transition: gap 0.2s;
}
.btn-detail:hover { gap: 0.6rem; }

/* Card enter animation */
.trash-card {
  animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Loading */
.loading-wrap {
  text-align: center;
  padding: 2rem;
  color: var(--ink-mid);
}
.loading-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 0.5rem; }
.loading-dots span {
  width: 8px; height: 8px;
  background: var(--brand-blue);
  border-radius: 50%;
  animation: bounce 1.2s infinite both;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%,80%,100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
}

/* ─── RANKINGS ──────────────────────────────────────────────── */
.rankings-section {
  padding: 4rem 1.5rem 5rem;
  background: var(--white);
}

.rank-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.rank-tab {
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-mid);
  border: none;
  background: #e8edef;
  transition: all 0.2s;
}
.rank-tab:hover { background: #bbebfa; color: var(--brand-blue); }
.rank-tab.active {
  background: var(--brand-blue);
  color: var(--white);
}

.rank-list {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #e8edef;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  border: none;
}
.rank-item:hover {
  background: #bbebfa;
  border-color: var(--ocean-mid);
  transform: translateX(4px);
}

.rank-pos {
  font-size: 1.3rem;
  font-weight: 900;
  min-width: 2rem;
  text-align: center;
  color: var(--ink-light);
}
.rank-pos.gold   { color: #F5A623; }
.rank-pos.silver { color: #A8A8A8; }
.rank-pos.bronze { color: #C87941; }

.rank-thumb {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--sand-dark);
  flex-shrink: 0;
}
.rank-info { flex: 1; min-width: 0; }
.rank-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-sub {
  font-size: 0.75rem;
  color: var(--ink-light);
  margin-top: 0.1rem;
}

.rank-score {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--brand-blue);
  flex-shrink: 0;
}
.rank-score-bar {
  width: 80px;
  height: 6px;
  background: var(--sand-dark);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 4px;
}
.rank-score-fill {
  height: 100%;
  background: var(--brand-blue);
  border-radius: 100px;
  transition: width 0.6s ease;
}

/* ─── SUBMIT ────────────────────────────────────────────────── */
.submit-section {
  padding: 4rem 1.5rem 5rem;
  background-image: url('../assets/beach-texture.png');
  background-size: cover;
  background-position: center;
}
.submit-wrap {
  max-width: 580px;
  margin: 0 auto;
}

.submit-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}
.req { color: var(--brand-orange); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--sand-dark);
  background: var(--white);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(59,175,217,0.15);
}
input.error, select.error, textarea.error {
  border-color: var(--brand-orange);
}
textarea { resize: vertical; min-height: 100px; }

/* File upload */
.upload-area {
  position: relative;
  border: 2px dashed var(--sand-dark);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
  cursor: pointer;
}
.upload-area:hover { border-color: var(--brand-blue); }
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
}
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--ink-mid);
}
.upload-icon { font-size: 2rem; }
.photo-preview {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  display: none;
  background: transparent;
}

/* Background removal status indicator */
.bg-remove-status {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-size: 0.82rem;
  text-align: center;
}
.bg-remove-loading {
  background: #eef7fd;
  color: #2a9ec7;
  animation: pulse 1.2s ease-in-out infinite;
}
.bg-remove-done {
  background: #edfaf3;
  color: #27a060;
}
.bg-remove-error {
  background: #fff3f3;
  color: #d9534f;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.btn-submit {
  width: 100%;
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--brand-blue);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}
.btn-submit:hover { background: var(--ocean-deep); transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { background: var(--ink-light); cursor: not-allowed; transform: none; }

.form-note {
  font-size: 0.75rem;
  color: var(--ink-light);
  text-align: center;
  line-height: 1.5;
}

/* Success state */
.submit-success {
  text-align: center;
  padding: 3rem 1rem;
}
.success-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.submit-success h3 { font-size: 1.4rem; font-weight: 900; margin-bottom: 0.5rem; }
.success-id {
  font-size: 0.85rem;
  color: var(--brand-blue);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.submit-success p { font-size: 0.9rem; color: var(--ink-mid); margin-bottom: 1.5rem; }

.btn-outline {
  padding: 0.65rem 2rem;
  border-radius: 100px;
  border: 2px solid var(--brand-blue);
  color: var(--brand-blue);
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: var(--brand-blue);
  color: var(--white);
}

/* ─── FOOTER ────────────────────────────────────────────────── */
.site-footer {
  background: var(--ocean);
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.footer-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.footer-logo {
  height: 66px;
  width: auto;
  object-fit: contain;
}
.footer-name { font-size: 1rem; font-weight: 900; color: var(--white); }
.footer-sub  { font-size: 0.75rem; color: rgba(255,255,255,0.75); }
.footer-copy { font-size: 0.75rem; color: rgba(255,255,255,0.6); }

/* ─── ABOUT DRAWER ──────────────────────────────────────────── */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
/* hidden attribute must win over display:flex */
.about-overlay[hidden] { display: none !important; }
.about-overlay.open { opacity: 1; pointer-events: auto; }

/* clicking the dim left area closes the drawer */
.about-overlay::before {
  content: '';
  flex: 1;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  cursor: pointer;
}

.about-panel {
  width: min(44vw, 500px);
  height: 100%;
  background: var(--white);
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.about-overlay.open .about-panel { transform: translateX(0); }

.about-close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #e8edef;
  color: var(--ink);
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 5;
}
.about-close:hover { background: #d0dde2; }

.about-content {
  padding: 3.5rem 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.about-logo {
  width: clamp(140px, 55%, 220px);
  height: auto;
  margin-bottom: 3rem;
}

.about-para {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--ink);
  margin-bottom: 1.1rem;
}

.about-xhs {
  margin-top: auto;
  padding-top: 3rem;
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
}
.about-xhs-left {
  flex: 1;
  min-width: 0;
}
.about-xhs-label {
  font-size: 0.82rem;
  color: var(--ink-mid);
  margin-bottom: 0.75rem;
}
.about-xhs-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--white);
  border: 1.5px solid #e0e0e0;
  border-radius: 100px;
  padding: 0.45rem 1rem 0.45rem 0.45rem;
}
.xhs-badge {
  background: #FF2442;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
}
.xhs-name {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 600;
  flex: 1;
}
.xhs-icon { font-size: 0.85rem; color: var(--ink-light); }

.about-qr {
  width: 130px;
  height: 130px;
  object-fit: contain;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .about-panel { width: 88vw; }
  .about-content { padding: 3rem 1.5rem 2.5rem; }
  .about-xhs { flex-direction: column; align-items: flex-start; }
  .about-qr { width: 110px; height: 110px; }
}

/* ─── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,36,22,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 860px;
  width: 100%;
  max-height: 90svh;
  overflow: hidden;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #e8edef;
  color: var(--ink);
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}
.modal-close:hover { background: #d0dde2; }

.modal-body { padding: 0; }

/* Horizontal layout */
.modal-layout {
  display: flex;
  min-height: 420px;
}
.modal-left {
  width: 42%;
  flex-shrink: 0;
  background: #e8edef;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-right {
  flex: 1;
  padding: 3.5rem 2rem 2rem;
  overflow-y: auto;
  max-height: 90svh;
  overscroll-behavior: contain;
}

.modal-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.5rem;
}

.modal-num {
  font-size: 0.72rem;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--brand-blue);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}
.modal-name {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 0.2rem;
}
.modal-latin {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-light);
  font-family: 'Courier New', monospace;
  margin-bottom: 1rem;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.modal-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  background: #e8edef;
  color: var(--ink-mid);
}
.modal-tag.cat { background: var(--brand-blue); color: var(--white); }

.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: #e8edef;
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.modal-info-item {}
.modal-info-label {
  font-size: 0.7rem;
  color: var(--ink-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
}
.modal-info-val {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 600;
}

.modal-desc-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.modal-desc {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--ink);
}

/* Score bars in modal */
.modal-scores {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.score-row { display: flex; align-items: center; gap: 0.75rem; }
.score-label { font-size: 0.75rem; color: var(--ink-mid); font-weight: 600; min-width: 52px; }
.score-bar-wrap { flex: 1; height: 6px; background: var(--sand-dark); border-radius: 100px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 100px; background: var(--brand-blue); transition: width 0.8s ease 0.2s; }
.score-val { font-size: 0.8rem; font-weight: 900; color: var(--brand-blue); min-width: 24px; text-align: right; }

/* Mobile modal = bottom sheet, vertical layout */
@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-box {
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 92svh;
    transform: translateY(100%);
    overflow-y: auto;
  }
  .modal-overlay.open .modal-box {
    transform: translateY(0);
  }
  .modal-layout {
    flex-direction: column;
  }
  .modal-left {
    width: 100%;
    min-height: 220px;
  }
  .modal-right {
    max-height: none;
    padding: 2rem 1.25rem 2rem;
    overflow-y: visible;
  }
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-topbar { padding: 1rem 1.25rem; }
  .hero-logo-img { height: 40px; }
  .hero-nav { bottom: 2.5rem; }
  .gallery-section, .rankings-section, .submit-section { padding: 3rem 1rem 4rem; }
  .stats-inner { gap: 0; }
  .stat-divider { display: none; }
  .stat { min-width: 50%; }
}

@media (max-width: 480px) {
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 0.5rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .gallery-grid { grid-template-columns: 1fr; }
  .hero-nav { gap: 0; }
  .nav-link { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
  .modal-info-grid { grid-template-columns: 1fr; }
}

/* ─── Placeholder image fallback ─────────────────────────────── */
img[src=""], img:not([src]) {
  visibility: hidden;
}
