:root {
  --bg-dark: #121612;
  --bg-panel: #1a211a;
  --bg-light-green: #2a382a;
  --green-accent: #8fd694;
  --green-muted: #5b8c60;
  --red-btn: #d93838;
  --red-hover: #b02a2a;
  --text-main: #f0f5f0;
  --text-muted: #9eab9e;
  --border-color: #2f3d2f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; object-fit: cover; }

/* Bamboo falling animation */
.bamboo-container {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bamboo {
  position: absolute;
  top: -100px;
  width: 8px;
  height: 60px;
  background: linear-gradient(to bottom, #4a6b4e, #2a382a);
  border-radius: 4px;
  opacity: 0.4;
  animation: fall linear infinite;
}
.bamboo::after {
  content: '';
  position: absolute;
  top: 20px; left: 6px;
  width: 12px; height: 4px;
  background: #4a6b4e;
  border-radius: 2px;
  transform: rotate(-30deg);
}
.bamboo:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
.bamboo:nth-child(2) { left: 30%; animation-duration: 12s; animation-delay: 2s; width: 6px; height: 40px; }
.bamboo:nth-child(3) { left: 50%; animation-duration: 10s; animation-delay: 5s; }
.bamboo:nth-child(4) { left: 70%; animation-duration: 15s; animation-delay: 1s; width: 10px; height: 80px; }
.bamboo:nth-child(5) { left: 85%; animation-duration: 9s; animation-delay: 4s; }
.bamboo:nth-child(6) { left: 95%; animation-duration: 11s; animation-delay: 7s; width: 5px; height: 50px; }
@keyframes fall {
  0% { transform: translateY(-100px) rotate(0deg); }
  100% { transform: translateY(100vh) rotate(360deg); }
}

/* Layout */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar / Nav */
.sidebar {
  width: 260px;
  background-color: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  height: 32px;
  width: auto;
}
.brand span {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--green-accent);
}
.nav-toggle {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  display: none; /* Hidden on desktop */
}
.nav-links li {
  margin-bottom: 0.8rem;
}
.nav-links a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.2s;
}
.nav-links a:hover {
  background-color: var(--bg-light-green);
  color: var(--green-accent);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
}

/* Hero Section */
.hero {
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-dark) 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.hero h1 {
  font-size: 2.5rem;
  color: var(--green-accent);
  margin-bottom: 1rem;
  line-height: 1.3;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2rem;
}
.download-btn {
  display: inline-block;
  background-color: var(--red-btn);
  color: #fff;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(217, 56, 56, 0.4);
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.download-btn:hover {
  background-color: var(--red-hover);
  transform: translateY(-2px);
}
.update-time {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Marquee */
.marquee-wrap {
  background-color: var(--bg-light-green);
  color: var(--green-accent);
  padding: 0.8rem 0;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.marquee-content {
  display: inline-block;
  animation: marquee 20s linear infinite;
  padding-left: 100%;
  font-size: 0.95rem;
}
.marquee-content span {
  margin-right: 3rem;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Common Section Styles */
section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.section-title {
  font-size: 1.8rem;
  color: var(--green-accent);
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 0.5rem;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; width: 60%; height: 2px;
  background-color: var(--green-accent);
}

/* Carousel */
.carousel-section {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}
.carousel-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 1rem;
}
.carousel-container::-webkit-scrollbar {
  display: none;
}
.carousel-item {
  flex: 0 0 300px;
  height: 400px;
  scroll-snap-align: center;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background-color: var(--bg-panel);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.carousel-item img {
  width: 100%;
  height: 100%;
  transition: transform 0.3s;
}
.carousel-item:hover img {
  transform: scale(1.05);
}
.play-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60px; height: 60px;
  background-color: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,0.8);
  transition: all 0.2s;
}
.carousel-item:hover .play-overlay {
  background-color: var(--red-btn);
  border-color: var(--red-btn);
}
.play-overlay::before {
  content: '';
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #fff;
  margin-left: 5px;
}

/* Grid Layouts for Sections */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}
.grid-item {
  background-color: var(--bg-panel);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s;
}
.grid-item:hover {
  transform: translateY(-5px);
}
.grid-item img {
  width: 100%;
  height: 260px;
}
.grid-item-text {
  padding: 1rem;
}
.grid-item-text h3 {
  font-size: 1rem;
  color: var(--green-accent);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid-item-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Highlights Section */
.highlights {
  background-color: var(--bg-panel);
  border-radius: 16px;
  padding: 3rem;
  border: 1px solid var(--border-color);
}
.highlights h2 {
  text-align: left;
  transform: none;
  left: 0;
  margin-bottom: 1rem;
}
.highlights p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* Ranking Section */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ranking-item {
  display: flex;
  align-items: center;
  background-color: var(--bg-panel);
  border-radius: 12px;
  padding: 1rem;
  gap: 1.5rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.ranking-item:hover {
  border-color: var(--green-muted);
  background-color: var(--bg-light-green);
}
.ranking-img {
  width: 80px;
  height: 110px;
  border-radius: 8px;
  object-fit: cover;
}
.ranking-info {
  flex: 1;
}
.ranking-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.ranking-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.ranking-stats span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.fire-icon { color: #ff5722; }

/* Danmaku Section */
.danmaku-section {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  cursor: pointer;
}
.danmaku-section img {
  width: 100%;
  height: auto;
  display: block;
}
.danmaku-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.danmaku-item {
  position: absolute;
  white-space: nowrap;
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  animation: danmaku-move linear forwards;
}
@keyframes danmaku-move {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}
.danmaku-section .play-overlay {
  width: 80px; height: 80px;
  background-color: rgba(217, 56, 56, 0.7);
  border-color: transparent;
}

/* History Section */
.history-section {
  text-align: left;
  max-width: 800px;
}
.history-section h2 {
  text-align: left;
  transform: none;
  left: 0;
}
.history-section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

/* FAQ Section */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  background-color: var(--bg-panel);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.faq-question {
  padding: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
  user-select: none;
}
.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--green-accent);
  transition: transform 0.2s;
}
.faq-item.active .faq-question::after {
  content: '−';
  transform: rotate(180deg);
}
.faq-answer {
  padding: 0 1.2rem 1.2rem;
  color: var(--text-muted);
  display: none;
}
.faq-item.active .faq-answer {
  display: block;
}

/* Comments Section */
.comments-section {
  max-width: 800px;
}
.comment-form {
  background-color: var(--bg-panel);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}
.comment-form textarea {
  width: 100%;
  height: 80px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding: 1rem;
  resize: none;
  margin-bottom: 1rem;
  font-family: inherit;
}
.comment-form textarea:focus {
  outline: none;
  border-color: var(--green-accent);
}
.comment-form button {
  background-color: var(--green-accent);
  color: var(--bg-dark);
  border: none;
  padding: 0.6rem 2rem;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}
.comment-form button:hover {
  opacity: 0.8;
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.comment-item {
  display: flex;
  gap: 1rem;
}
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-light-green);
  padding: 6px;
  flex-shrink: 0;
}
.comment-content {
  background-color: var(--bg-panel);
  padding: 1rem;
  border-radius: 0 12px 12px 12px;
  flex: 1;
  border: 1px solid var(--border-color);
}
.comment-user {
  font-size: 0.9rem;
  color: var(--green-accent);
  margin-bottom: 0.3rem;
  font-weight: bold;
}
.comment-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-overlay.show {
  display: flex;
}
.modal-box {
  background-color: var(--bg-panel);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  border: 1px solid var(--green-muted);
}
.modal-box h3 {
  color: var(--green-accent);
  margin-bottom: 1rem;
  font-size: 1.4rem;
}
.modal-box p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.modal-btn {
  background-color: var(--red-btn);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  display: inline-block;
  font-weight: bold;
}

/* Footer */
footer {
  background-color: var(--bg-panel);
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}
footer p {
  margin-bottom: 0.5rem;
}
footer a {
  color: var(--text-muted);
  transition: color 0.2s;
}
footer a:hover {
  color: var(--green-accent);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero h1 { font-size: 2rem; }
  .grid-container { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 768px) {
  .page-wrapper { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    margin-top: 1rem;
  }
  .nav-links.show {
    display: block;
  }
  .nav-links li { margin-bottom: 0.5rem; }
  .main-content { margin-left: 0; }
  .hero { padding: 3rem 1rem; min-height: 50vh; }
  .hero h1 { font-size: 1.8rem; }
  .carousel-item { flex: 0 0 250px; height: 340px; }
  .highlights { padding: 1.5rem; }
  .ranking-item { flex-direction: column; text-align: center; align-items: center; }
  .ranking-stats { justify-content: center; }
  section { padding: 2rem 1rem; }
  .grid-item img { height: 200px; }
}