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

:root {
  --cream: #FAF3E6;
  --cream-dark: #F0E6D3;
  --green: #4A7C59;
  --green-light: #7DAF8C;
  --green-pale: #C8E0D0;
  --green-mist: #E8F0E4;
  --gold: #D4A574;
  --gold-light: #E8C9A0;
  --gold-pale: #F5E6D3;
  --brown: #5C4033;
  --brown-dark: #3C2415;
  --brown-light: #8B7355;
  --text: #3C2415;
  --text-light: #7A6055;
  --shadow: rgba(92, 64, 51, 0.08);
  --shadow-hover: rgba(92, 64, 51, 0.15);
  --transition: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Main Section ── */
.main-section {
  display: block;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--cream) 0%, var(--green-mist) 100%);
}

.main-header {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 165, 116, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}



/* ── Brand Signature ── */
.brand-sign {
  font-size: 14px;
  color: var(--text-light);
  letter-spacing: 3px;
  font-weight: 400;
  opacity: 0.8;
  font-style: italic;
}

/* ── Apple Tree Banner ── */
.tree-banner {
  text-align: center;
  padding: 40px 20px 20px;
  position: relative;
}

.apple-tree {
  position: relative;
  display: inline-block;
  width: 320px;
  height: 340px;
}

.tree-glow {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(212, 165, 116, 0.12) 0%, rgba(212, 165, 116, 0.05) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.tree-trunk {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 120px;
  background: linear-gradient(90deg, #4A3528 0%, #6B4C3B 20%, #7A5A44 50%, #6B4C3B 80%, #4A3528 100%);
  border-radius: 3px 3px 15px 15px;
  z-index: 2;
}

.tree-trunk::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 60%;
  height: 70%;
  background: repeating-linear-gradient(0deg, transparent, transparent 6px, rgba(0,0,0,0.04) 6px, rgba(0,0,0,0.04) 7px);
  border-radius: 2px;
}

.tree-canopy {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 240px;
  z-index: 1;
}

.canopy-blob {
  position: absolute;
  border-radius: 50%;
}

.cb-1 {
  width: 170px; height: 150px;
  top: 15%; left: 0%;
  background: radial-gradient(ellipse at 35% 30%, #A8D5B6 0%, #7CC49A 25%, #5AAC7D 55%, #3D8A5E 85%);
  box-shadow: 0 4px 20px rgba(74, 124, 89, 0.15);
}

.cb-2 {
  width: 150px; height: 140px;
  top: 5%; left: 30%;
  background: radial-gradient(ellipse at 40% 35%, #B5DDC0 0%, #85C9A0 25%, #62B485 55%, #449966 85%);
  box-shadow: 0 4px 20px rgba(74, 124, 89, 0.15);
}

.cb-3 {
  width: 160px; height: 150px;
  top: 20%; left: 20%;
  background: radial-gradient(ellipse at 45% 30%, #A0D0B0 0%, #71BE90 25%, #4EA874 55%, #3A7F55 85%);
  box-shadow: 0 4px 20px rgba(74, 124, 89, 0.2);
}

.cb-4 {
  width: 130px; height: 120px;
  top: 35%; left: 5%;
  background: radial-gradient(ellipse at 40% 35%, #90C8A2 0%, #65B485 25%, #48A06E 55%, #2E7A4E 85%);
  box-shadow: 0 4px 15px rgba(74, 124, 89, 0.15);
}

.cb-5 {
  width: 140px; height: 130px;
  top: 30%; left: 40%;
  background: radial-gradient(ellipse at 40% 30%, #95CBA7 0%, #6AB888 25%, #4DA872 55%, #318255 85%);
  box-shadow: 0 4px 15px rgba(74, 124, 89, 0.15);
}

.apple {
  position: absolute;
  width: 20px;
  height: 22px;
  z-index: 3;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 35% 25%, #FF8A80 0%, #E74C3C 40%, #C0392B 70%, #922B21 100%);
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.3), inset 0 2px 6px rgba(255, 255, 255, 0.2);
  cursor: default;
}

.apple::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 2.5px;
  height: 6px;
  background: #5C3D2E;
  border-radius: 1px;
}

.apple::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 6px;
  width: 6px;
  height: 5px;
  background: radial-gradient(circle, rgba(255,255,255,0.35), transparent);
  border-radius: 50%;
}

.a1 { top: 22%; left: 22%; }
.a2 { top: 32%; left: 58%; }
.a3 { top: 48%; left: 28%; }
.a4 { top: 28%; left: 15%; }
.a5 { top: 52%; left: 52%; }
.a6 { top: 18%; left: 48%; }
.a7 { top: 42%; left: 42%; }

.tree-ground {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 24px;
  background: radial-gradient(ellipse at center, rgba(74, 124, 89, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

.tree-leaf {
  position: absolute;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  animation: leafFall 7s ease-in infinite;
  z-index: 4;
}

.tree-leaf:nth-child(1) { top: 12%; left: 10%; animation-delay: 0s; }
.tree-leaf:nth-child(2) { top: 18%; left: 70%; animation-delay: 2.5s; }
.tree-leaf:nth-child(3) { top: 8%; left: 45%; animation-delay: 5s; }

@keyframes leafFall {
  0%   { opacity: 0; transform: translateY(0) translateX(0) rotate(0deg); }
  10%  { opacity: 0.5; }
  80%  { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(200px) translateX(30px) rotate(200deg); }
}

/* ── Module Toolbar ── */
.module-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
  padding: 0 0 16px;
}

.toolbar-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.search-row .search-box {
  flex: 1;
  max-width: none;
}
.search-row .rankings-toggle {
  flex-shrink: 0;
}

.search-box {
  position: relative;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1.5px solid rgba(212, 165, 116, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: var(--text-light);
  opacity: 0.6;
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

.category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-btn {
  padding: 6px 18px;
  border: 1.5px solid rgba(212, 165, 116, 0.15);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
}

.cat-btn:hover {
  border-color: var(--gold-light);
  background: rgba(255, 255, 255, 0.8);
  color: var(--brown);
}

.cat-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ── Module Grid ── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px 60px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 20px 0;
}

.module-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.module-card-link .module-card {
  cursor: pointer;
}

.module-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 165, 116, 0.12);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  transition: all 0.4s ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-pale), var(--gold), var(--green-pale));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.module-card:hover::before {
  opacity: 1;
}

.module-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px var(--shadow-hover);
  border-color: rgba(212, 165, 116, 0.25);
}

.coming-soon {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
  filter: grayscale(0.5);
}

.card-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  transition: transform 0.4s ease;
}

.module-card:hover .card-icon {
  transform: scale(1.15) rotate(-5deg);
}

.card-title {
  font-size: 20px;
  color: var(--brown);
  letter-spacing: 4px;
  margin-bottom: 10px;
  font-weight: 700;
}

.card-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 16px;
}

.card-badge {
  display: inline-block;
  padding: 4px 16px;
  font-size: 12px;
  color: var(--green);
  background: rgba(74, 124, 89, 0.08);
  border: 1px solid rgba(74, 124, 89, 0.15);
  border-radius: 20px;
  letter-spacing: 2px;
}

/* ── Footer ── */
.main-footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  position: relative;
}

.main-footer p {
  font-size: 14px;
  letter-spacing: 4px;
}

.footer-icp {
  margin: 6px 0;
  font-size: 13px;
}
.footer-icp a {
  color: var(--text-light, #888);
  text-decoration: none;
}
.footer-icp a:hover {
  text-decoration: underline;
}
.footer-sub {
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.7;
}

.footer-legal {
  font-size: 11px;
  margin-top: 12px;
  opacity: 0.5;
  line-height: 1.8;
  letter-spacing: 2px; 
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Rankings ── */
.rankings-toggle {
  padding: 10px 18px; border: 1.5px solid rgba(212,165,116,0.15);
  border-radius: 12px; background: rgba(255,255,255,0.6);
  font-family: 'Noto Serif SC', serif; font-size: 14px;
  color: var(--brown-light); cursor: pointer; transition: all 0.3s ease;
  letter-spacing: 2px; white-space: nowrap; flex-shrink: 0;
}
.rankings-toggle:hover {
  border-color: var(--gold); color: var(--brown); background: rgba(255,255,255,0.85);
}

.rankings-popup {
  background: rgba(255,255,255,0.95); backdrop-filter: blur(12px);
  border: 1px solid rgba(212,165,116,0.12);
  border-radius: 16px; overflow: hidden;
  margin-top: 12px; display: none;
  box-shadow: 0 8px 30px rgba(60,36,21,0.1);
}
.rankings-popup.show { display: block; }
.rankings-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px 12px;
}
.rankings-header h2 {
  font-size: 18px; font-family: 'Ma Shan Zheng', 'KaiTi', cursive;
  color: var(--brown); letter-spacing: 4px; margin: 0;
}
.rankings-close {
  width: 28px; height: 28px; border: none; background: rgba(0,0,0,0.04);
  border-radius: 6px; font-size: 14px; color: var(--text-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rankings-close:hover { background: rgba(192,57,43,0.08); color: #C0392B; }
.rankings-list {
  background: rgba(255,255,255,0.5);
  border-radius: 16px;
  border: 1px solid rgba(212,165,116,0.1);
  overflow: hidden;
}
.rankings-placeholder {
  text-align: center;
  padding: 30px;
  color: var(--text-light);
  font-size: 14px;
}
.rank-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(212,165,116,0.06);
  transition: background 0.2s;
}
.rank-item:last-child { border-bottom: none; }
.rank-item:hover { background: rgba(255,255,255,0.4); }
.rank-num {
  width: 28px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  text-align: center;
  flex-shrink: 0;
}
.rank-num.top1 { color: #FF6B35; font-size: 18px; }
.rank-num.top2 { color: #E67E22; font-size: 16px; }
.rank-num.top3 { color: #F39C12; font-size: 15px; }
.rank-icon { font-size: 24px; margin: 0 12px; flex-shrink: 0; }
.rank-name { flex: 1; font-size: 14px; color: var(--brown); letter-spacing: 2px; }
.rank-hits {
  font-size: 14px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.rank-bar-bg {
  width: 100px;
  height: 6px;
  background: rgba(212,165,116,0.12);
  border-radius: 3px;
  margin-left: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.rank-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--green-light));
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ── 赞赏 ── */
.reward-btn {
  position: fixed; bottom: 24px; left: 24px; z-index: 999;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.85); border: 1px solid rgba(212,165,116,0.15);
  box-shadow: 0 2px 12px rgba(60,36,21,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; transition: all 0.3s;
  user-select: none;
}
.reward-btn:hover { transform: scale(1.1); box-shadow: 0 4px 20px rgba(212,165,116,0.25); }

.reward-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(60,36,21,0.3); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.reward-overlay.show { opacity: 1; pointer-events: auto; }
.reward-modal {
  background: #fff; border-radius: 20px; width: 340px; max-width: 88vw;
  box-shadow: 0 30px 80px rgba(60,36,21,0.2); overflow: hidden;
  transform: translateY(20px); transition: transform 0.3s;
}
.reward-overlay.show .reward-modal { transform: translateY(0); }
.reward-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px 12px; border-bottom: 1px solid rgba(212,165,116,0.1);
}
.reward-header span { font-size: 16px; color: var(--brown); letter-spacing: 2px; }
.reward-close {
  width: 28px; height: 28px; border: none; background: rgba(0,0,0,0.04);
  border-radius: 6px; font-size: 14px; color: var(--text-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.reward-close:hover { background: rgba(192,57,43,0.08); color: #C0392B; }
.reward-body { padding: 20px; text-align: center; }
.reward-body img { max-width: 220px; border-radius: 12px; }
.reward-tip { font-size: 13px; color: var(--text-light); margin-top: 12px; letter-spacing: 1px; }

/* ── Responsive ── */
.about-btn {
  padding: 6px 16px; font-family: 'Noto Serif SC', serif; font-size: 13px;
  letter-spacing: 1px; color: var(--brown-light);
  background: rgba(255,255,255,0.4); border: 1px solid rgba(212,165,116,0.15);
  border-radius: 8px; cursor: pointer; transition: all 0.3s ease;
}
.about-btn:hover { color: var(--brown); border-color: var(--gold); background: rgba(255,255,255,0.7); }

.about-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(60,36,21,0.4); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.about-overlay.show { opacity: 1; pointer-events: auto; }
.about-modal {
  background: #fff; border-radius: 24px; width: 560px; max-width: 92vw;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 40px 100px rgba(60,36,21,0.3);
  transform: translateY(30px); transition: transform 0.4s ease;
}
.about-overlay.show .about-modal { transform: translateY(0); }
.about-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 28px 18px; border-bottom: 1px solid rgba(212,165,116,0.12); flex-shrink: 0;
}
.about-header h2 {
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: 24px; color: var(--brown); letter-spacing: 3px; margin: 0;
}
.about-close {
  width: 32px; height: 32px; border: none; background: rgba(0,0,0,0.04);
  border-radius: 8px; font-size: 16px; color: var(--text-light); cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.about-close:hover { background: rgba(192,57,43,0.08); color: #C0392B; }
.about-body {
  padding: 28px 28px 36px; overflow-y: auto; flex: 1;
}
.about-section { text-align: center; padding: 8px 0; }
.about-section h3 {
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', cursive;
  font-size: 22px; color: var(--brown); letter-spacing: 4px; margin: 10px 0 4px;
}
.about-avatar { font-size: 48px; }
.about-role { font-size: 13px; color: var(--gold); letter-spacing: 3px; margin-bottom: 12px; }
.about-section p { font-size: 14px; color: var(--text); line-height: 1.8; letter-spacing: 1px; max-width: 420px; margin: 0 auto; }
.about-divider {
  width: 60px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold-pale), transparent);
  margin: 20px auto;
}

@media (max-width: 640px) {
  .about-modal { width: 96vw; }
  .about-body { padding: 20px 16px 28px; }

  .eden-subtitle {
    letter-spacing: 8px;
  }

  .enter-btn {
    padding: 14px 36px;
    font-size: 16px;
    letter-spacing: 4px;
  }

  .header-inner {
    flex-direction: column;
    gap: 8px;
    padding: 14px 20px;
  }

  .module-toolbar {
    padding: 0;
  }

  .search-box {
    max-width: 100%;
  }

  .module-grid {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }

  .tree-banner {
    padding: 24px 10px 10px;
  }

  .apple-tree {
    width: 240px;
    height: 260px;
  }

  .tree-canopy {
    width: 210px;
    height: 180px;
  }

  .cb-1 { width: 130px; height: 110px; }
  .cb-2 { width: 110px; height: 100px; top: 8%; }
  .cb-3 { width: 120px; height: 110px; }
  .cb-4 { width: 100px; height: 90px; }
  .cb-5 { width: 100px; height: 95px; }

  .apple { width: 16px; height: 18px; }
  .apple::before { width: 2px; height: 5px; top: -4px; }
  .apple::after { width: 5px; height: 4px; top: 4px; left: 4px; }

  .tree-trunk { width: 20px; height: 90px; bottom: 38px; }
  .tree-ground { width: 160px; height: 18px; bottom: 28px; }
  .tree-glow { width: 220px; height: 200px; }
}

/* ── Install Button ── */
.install-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 16px;
  background: var(--green);
  color: white;
  border: 2px solid var(--green);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: var(--transition);
}
.install-btn:hover { background: var(--green-light); }
.install-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Site notice ── */
.site-notice {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-light);
  opacity: 0.7;
  animation: floatNotice 3s ease-in-out infinite;
  line-height: 1.4;
}

@keyframes floatNotice {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.studio-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  margin-left: 12px;
}

.studio-link img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.studio-link span {
  font-size: 13px;
  font-weight: 500;
}
