/* ============================================
   若汐の杂货铺 — MEGO 主题克隆版
   100% 复刻 熊の杂货铺 风格
   ============================================ */

:root {
  --bg: #aa9d9d;
  --bg-light: #f0f0f0;
  --card-bg: rgba(255,255,255,0.12);
  --text: black;
  --text-soft: #606060;
  --accent: #08d;
  --accent-hover: #06b;
  --info: #606060;
  --warning: #dc2f55;
  --border-radius: 0.75rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --max: 1200px;
  --shadow-card: 0 18px 60px rgba(0,0,0,0.25);
  --shadow-hover: 0 26px 70px rgba(0,0,0,0.35);
  --header-bg: rgba(170,157,157,0.88);
  --card-glass: rgba(255,255,255,0.1);
  --card-border: rgba(255,255,255,0.2);
  --overlay-dark: rgba(0,0,0,0.8);
  --overlay-mid: rgba(0,0,0,0.5);
  --overlay-light: rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Loading Screen ── */
#global-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.5s ease;
}
#global-loading.hidden { opacity: 0; pointer-events: none; }

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.loading-rings {
  position: relative;
  width: 120px;
  height: 120px;
}
.loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}
.loading-ring-1 {
  border-top-color: #606060;
  border-right-color: #808080;
  animation: spin 1.5s linear infinite;
}
.loading-ring-2 {
  inset: 12px;
  border-bottom-color: #707070;
  border-left-color: #909090;
  animation: spin 2s linear infinite reverse;
}
.loading-dots {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 32px;
}
.loading-dot {
  width: 6px;
  border-radius: 50%;
  background: #404040;
  animation: pulse 1s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.15s; height: 20px; }
.loading-dot:nth-child(3) { animation-delay: 0.3s; height: 14px; }
.loading-dot:nth-child(4) { animation-delay: 0.45s; height: 18px; }
.loading-dot:nth-child(5) { animation-delay: 0.6s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.5); }
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  min-height: 68px;
  gap: 20px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0e8e0, #dce8ec);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  transition: background 0.2s ease, color 0.2s ease;
}
.nav a:hover,
.nav a.active {
  background: rgba(255,255,255,0.2);
  color: var(--text);
}

/* Theme Toggle */
.theme-toggle {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d0d0d0;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}
.theme-toggle.dark {
  background: #4a4a4a;
}
.theme-toggle.dark::after {
  transform: translateX(20px);
  background: #f5a623;
}

/* Mobile menu button */
.mobile-btn {
  display: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-soft);
}

/* ── Hero Section (MEGO Clone) ── */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.hero-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}

.hero-shade {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0,0,0,0.8);
}

.hero-content-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  min-height: 600px;
  padding: 80px 20px 60px;
}

.hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  width: 100%;
  padding: 40px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
}

/* Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.4);
  background: linear-gradient(135deg, rgba(255,200,100,0.2), rgba(255,100,100,0.3));
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, white, #ff8c00);
  animation: pulse 1.5s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: white;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: clamp(15px, 2.5vw, 20px);
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: bounce 2s ease-in-out infinite;
}
.hero-scroll-hint svg {
  filter: drop-shadow(0 2px 8px rgba(255,255,255,0.4));
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ── Main Content ── */
.main-content {
  position: relative;
  z-index: 10;
  background: var(--bg);
  padding: 0 0 60px;
}

/* ── Stats Section ── */
.stats-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 20px 60px;
}
.stats-title {
  text-align: center;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 12px;
}
.stats-subtitle {
  text-align: center;
  font-size: 18px;
  color: var(--text-soft);
  margin-bottom: 48px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.06);
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: rgba(255,255,255,0.5);
  text-align: center;
  transition: background 0.2s ease;
}
.stat-card:hover { background: rgba(255,255,255,0.75); }
.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

/* ── Section Header ── */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 20px 40px;
}
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 10px;
}
.section-header p {
  font-size: 17px;
  color: var(--text-soft);
}

/* ── Post Cards Grid (MEGO Clone) ── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.post-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--card-bg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.post-card-image {
  position: relative;
  height: 320px;
  overflow: hidden;
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}
.post-card-image img.loaded { opacity: 1; }
.post-card:hover .post-card-image img { transform: scale(1.04); }

/* MEGO 风格渐变叠加 */
.post-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.80) 0%,
    rgba(0,0,0,0.30) 50%,
    rgba(0,0,0,0.20) 100%
  );
}

.post-card-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.post-card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}
.post-card-meta img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.post-card-title {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  line-height: 1.3;
  color: white;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.post-card-title a { color: inherit; }
.post-card-excerpt {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 16px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.post-card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}
.post-card-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 600;
  color: white;
  transition: background 0.2s ease, transform 0.2s ease;
}
.read-more-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.03);
}

/* ── WANDERER Section ── */
.wanderer-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 20px 40px;
}
.wanderer-header {
  text-align: center;
  margin-bottom: 40px;
}
.wanderer-header h2 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 8px;
}
.wanderer-header p {
  font-size: 17px;
  color: var(--text-soft);
}
.wanderer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.wanderer-card {
  width: 160px;
  height: 96px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wanderer-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
.wanderer-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.7);
}
.wanderer-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
}
.wanderer-card-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.wanderer-card-content h3 {
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-align: center;
}
.wanderer-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid white;
  background: transparent;
}

/* ── Footer ── */
.site-footer {
  background: var(--bg);
  padding: 40px 20px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer-copy strong {
  font-size: 18px;
  font-weight: 700;
}
.footer-copy p {
  font-size: 14px;
  color: var(--text-soft);
}
.footer-meta {
  font-size: 13px;
  color: var(--text-soft);
}
.footer-links {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--text-soft);
}
.footer-links a:hover { color: var(--text); }

.footer-credits {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 8px;
}
.footer-credits a { color: var(--text-soft); text-decoration: underline; }

/* Social icons */
.social-icons {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}
.social-icons a {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--text-soft);
  transition: color 0.2s ease;
}
.social-icons a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .posts-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .mobile-btn { display: block; }
  .hero-box { padding: 24px; }
}
