:root {
    --bg: #050505;
    --bg-card: #121212;
    --pink: #ff2a75;
    --pink-glow: rgba(255, 42, 117, 0.3);
    --yellow: #ffcc00;
    --text: #f0f0f0;
    --text-muted: #a0a0a0;
    --border: #222;
    --radius: 12px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    overflow-x: hidden;
  }

  /* Pencil Rain Background */
  .pencil-rain {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
  }
  .pencil {
    position: absolute;
    top: -100px;
    width: 6px;
    height: 40px;
    background: linear-gradient(to bottom, var(--pink) 80%, #fff 80%, #fff 90%, #333 90%);
    border-radius: 2px;
    opacity: 0.15;
    animation: fall linear infinite;
  }
  @keyframes fall {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(110vh) rotate(360deg); }
  }
  .pencil:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
  .pencil:nth-child(2) { left: 25%; animation-duration: 12s; animation-delay: 2s; }
  .pencil:nth-child(3) { left: 40%; animation-duration: 9s; animation-delay: 4s; }
  .pencil:nth-child(4) { left: 55%; animation-duration: 15s; animation-delay: 1s; }
  .pencil:nth-child(5) { left: 70%; animation-duration: 11s; animation-delay: 3s; }
  .pencil:nth-child(6) { left: 85%; animation-duration: 13s; animation-delay: 5s; }
  .pencil:nth-child(7) { left: 95%; animation-duration: 10s; animation-delay: 6s; }

  /* Base Layout */
  .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
  .section-title { text-align: center; font-size: 28px; margin-bottom: 10px; color: #fff; }
  .section-title span { color: var(--pink); }
  .section-desc { text-align: center; color: var(--text-muted); font-size: 15px; margin-bottom: 40px; }
  section { padding: 60px 0; border-bottom: 1px solid var(--border); }
  img { max-width: 100%; display: block; }
  a { text-decoration: none; color: inherit; }

  /* Header & Nav */
  header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .nav-bar { display: flex; justify-content: space-between; align-items: center; height: 60px; }
  .logo-area { display: flex; align-items: center; gap: 10px; }
  .logo-area img { height: 32px; width: auto; border-radius: 4px; }
  .logo-text { font-size: 18px; font-weight: bold; color: #fff; }
  .nav-toggle {
    background: transparent;
    border: 1px solid var(--pink);
    color: var(--pink);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 60px; left: 0; width: 100%;
    background: #111;
    border-bottom: 1px solid var(--pink);
    flex-direction: column;
    padding: 10px 20px;
  }
  .nav-menu.active { display: flex; }
  .nav-menu a { padding: 12px 0; color: #ddd; font-size: 15px; border-bottom: 1px solid #222; }
  .nav-menu a:last-child { border-bottom: none; }
  .nav-menu a:hover { color: var(--pink); }

  /* Hero */
  .hero { padding: 60px 0 40px; text-align: center; }
  .hero h1 { font-size: 32px; line-height: 1.3; margin-bottom: 20px; color: #fff; }
  .hero h1 span { color: var(--pink); text-shadow: 0 0 15px var(--pink-glow); }
  .hero p { font-size: 16px; color: var(--text-muted); margin-bottom: 30px; max-width: 600px; margin-left: auto; margin-right: auto; }
  .btn-download {
    display: inline-block;
    background: var(--yellow);
    color: #000;
    font-size: 18px;
    font-weight: bold;
    padding: 15px 40px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .btn-download:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 204, 0, 0.5); }
  .update-time { margin-top: 15px; font-size: 12px; color: #666; }

  /* Carousel */
  .carousel-wrapper { position: relative; margin: 40px auto 80px; max-width: 1000px; padding: 0 10px; }
  .carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 20px; padding-bottom: 20px; scrollbar-width: none; }
  .carousel::-webkit-scrollbar { display: none; }
  .card { flex: 0 0 80%; scroll-snap-align: center; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; position: relative; border: 1px solid #333; transition: transform 0.3s; }
  .card:hover { transform: scale(1.02); border-color: var(--pink); }
  .card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
  .play-btn {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; border: 2px solid rgba(255,255,255,0.8); transition: all 0.3s;
  }
  .play-btn::after {
    content: ''; display: block; width: 0; height: 0;
    border-top: 12px solid transparent; border-bottom: 12px solid transparent;
    border-left: 20px solid #fff; margin-left: 6px;
  }
  .card:hover .play-btn { background: var(--pink); border-color: var(--pink); }
  .card-title { padding: 15px; font-size: 16px; text-align: center; color: #fff; font-weight: 500; }

  /* Marquee */
  .marquee-bar { background: var(--pink); color: #fff; padding: 10px 0; overflow: hidden; white-space: nowrap; font-weight: bold; font-size: 15px; display: flex; }
  .marquee-content { display: inline-block; animation: scroll-left 20s linear infinite; padding-left: 100%; }
  @keyframes scroll-left { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

  /* Grid Layouts */
  .grid-6 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
  .grid-3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* Library */
  .lib-item { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
  .lib-item .img-box { position: relative; }
  .lib-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
  .lib-text { padding: 12px; font-size: 14px; color: #ddd; text-align: center; }

  /* Features */
  .feature-text { background: #111; border: 1px solid var(--border); padding: 30px; border-radius: var(--radius); color: var(--text-muted); font-size: 15px; line-height: 1.8; position: relative; }
  .feature-text h3 { color: var(--pink); margin-bottom: 15px; font-size: 20px; }
  .feature-text p { margin-bottom: 15px; }

  /* Ranking */
  .rank-list { display: flex; flex-direction: column; gap: 15px; }
  .rank-item { display: flex; gap: 15px; background: var(--bg-card); padding: 15px; border-radius: var(--radius); border: 1px solid var(--border); align-items: center; }
  .rank-item img { width: 80px; height: 110px; object-fit: cover; border-radius: 6px; }
  .rank-info { flex: 1; }
  .rank-info h4 { font-size: 16px; color: #fff; margin-bottom: 5px; }
  .rank-stats { color: var(--pink); font-size: 13px; font-weight: bold; }

  /* Danmaku */
  .danmaku-player { position: relative; border-radius: var(--radius); overflow: hidden; border: 2px solid #333; background: #000; max-width: 800px; margin: 0 auto; }
  .danmaku-player img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
  .danmaku-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
  .dm { position: absolute; white-space: nowrap; font-size: 18px; color: #fff; text-shadow: 1px 1px 2px #000; font-weight: bold; animation: dm-move linear forwards; }
  @keyframes dm-move { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }

  /* History */
  .history-box { background: #111; border-left: 4px solid var(--pink); padding: 20px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-muted); font-size: 15px; }

  /* FAQ */
  .faq-list { display: flex; flex-direction: column; gap: 10px; }
  details { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
  summary { padding: 15px 20px; cursor: pointer; font-weight: 500; color: #fff; list-style: none; display: flex; justify-content: space-between; align-items: center; }
  summary::-webkit-details-marker { display: none; }
  summary::after { content: '+'; color: var(--pink); font-size: 20px; }
  details[open] summary::after { content: '-'; }
  details[open] summary { border-bottom: 1px solid var(--border); }
  .faq-content { padding: 15px 20px; color: var(--text-muted); font-size: 14px; }

  /* Comments */
  .comments-area { margin-top: 40px; }
  .comment-form { background: #111; padding: 20px; border-radius: var(--radius); margin-bottom: 30px; }
  .comment-form textarea { width: 100%; height: 100px; background: #222; border: 1px solid #333; color: #fff; padding: 10px; border-radius: 8px; resize: none; margin-bottom: 10px; font-family: inherit; }
  .comment-form button { background: var(--pink); color: #fff; border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; font-weight: bold; }
  .comment-list { display: flex; flex-direction: column; gap: 15px; }
  .comment-item { display: flex; gap: 15px; background: var(--bg-card); padding: 15px; border-radius: var(--radius); border: 1px solid var(--border); }
  .comment-item img { width: 40px; height: 40px; border-radius: 50%; object-fit: contain; background: #333; padding: 2px; }
  .comment-body { flex: 1; }
  .comment-name { color: #888; font-size: 13px; margin-bottom: 5px; }
  .comment-text { color: #ddd; font-size: 14px; }

  /* Toast */
  .toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); background: rgba(0,0,0,0.9); border: 1px solid var(--pink); color: #fff; padding: 20px 40px; border-radius: 10px; font-size: 16px; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 1000; text-align: center; pointer-events: none; }
  .toast.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }

  /* Footer */
  footer { padding: 40px 0 20px; text-align: center; font-size: 12px; color: #666; }
  footer p { margin-bottom: 10px; }
  footer a { color: #888; transition: color 0.2s; }
  footer a:hover { color: var(--pink); }
  
  /* About Us Details */
  .about-us { margin-top: 20px; text-align: left; max-width: 800px; margin-left: auto; margin-right: auto; background: #0a0a0a; border: 1px solid #222; border-radius: 6px; }
  .about-us summary { font-size: 12px; color: #666; padding: 10px 15px; cursor: pointer; display: block; }
  .about-us summary::-webkit-details-marker { display: none; }
  .about-us summary:hover { color: #999; }
  .about-links { padding: 15px; display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px solid #222; }
  .about-links a { font-size: 12px; color: #555; }
  .about-links a:hover { color: var(--pink); }

  /* Media Queries */
  @media (min-width: 768px) {
    .nav-toggle { display: none; }
    .nav-menu { display: flex; position: static; flex-direction: row; background: none; border: none; padding: 0; gap: 20px; }
    .nav-menu a { border: none; padding: 0; font-size: 15px; color: #aaa; }
    
    .card { flex: 0 0 40%; }
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    
    .hero h1 { font-size: 42px; }
    .section-title { font-size: 32px; }
    
    .rank-list { display: grid; grid-template-columns: 1fr 1fr; }
  }

  @media (min-width: 1024px) {
    .nav-menu a { font-size: 16px; }
    .card { flex: 0 0 28%; }
    .grid-6 { grid-template-columns: repeat(6, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    
    .hero h1 { font-size: 48px; }
    .section-title { font-size: 36px; }
  }