/* ===== RESPONSIVE / MOBILE FIXES ===== */

/* Hide desktop-only cursor on touch devices */
@media (hover: none) {
  .cursor, .cursor-ring { display: none; }
  body { cursor: auto; }
}

/* === TABLET (max 900px only — 桌面不受影响) === */
@media (max-width: 900px) {
  nav { padding: 1rem 2rem; }

  .hero { padding: 0 2rem 3rem; }

  .hero-right {
    width: 50%;
    right: 2rem;
  }

  .about-section {
    padding: 5rem 2rem;
    gap: 3rem;
  }

  .contact-section {
    padding: 5rem 2rem;
    gap: 2.5rem;
  }

  section { padding: 5rem 2rem; }

  .detail-grid { gap: 2.5rem; }
}

/* === MOBILE (max 768px) === */
@media (max-width: 768px) {

  /* Nav */
  nav { padding: 1rem 1.25rem; }
  .nav-links { gap: 1.25rem; }
  .nav-links a { font-size: 10px; }

  /* Hero — stack vertically */
  .hero {
    padding: 0 1.25rem 3rem;
    min-height: 100svh;
    justify-content: flex-end;
  }

  /* Right panel: pull out of absolute, stack above */
  .hero-right {
    position: static;
    transform: none;
    width: 100%;
    margin-bottom: 1.5rem;
    order: -1;
    pointer-events: auto;
  }

  .hero-stats { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 1.4rem; }

  /* Typewriter */
  .hero-typewriter {
    position: static;
    transform: none;
    pointer-events: auto;
    margin-bottom: 0.5rem;
  }
  #typeText, .type-cursor {
    font-size: clamp(28px, 8vw, 52px);
  }

  .hero-tag { font-size: 9px; margin-bottom: 1rem; }

  .hero-title {
    font-size: clamp(34px, 9vw, 56px);
    margin-bottom: 0.5rem;
  }
  .hero-sub {
    font-size: clamp(18px, 5.5vw, 28px);
    margin-bottom: 1.5rem;
  }

  /* Hero bottom */
  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .hero-desc { max-width: 100%; font-size: 13px; }
  .hero-cta { flex-direction: row; align-items: center; gap: 12px; }

  .scroll-indicator { display: none; }

  /* Sections */
  section { padding: 3rem 1.25rem; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.wide { grid-column: span 1; }
  .project-card { padding: 1.75rem 1.25rem; }
  .project-title { font-size: 24px; }
  .project-desc { max-width: 100%; }

  /* Project detail */
  .project-detail { padding: 2rem 1.25rem; }
  .detail-grid { grid-template-columns: 1fr; gap: 2rem; }
  .detail-meta-title { font-size: 30px; }

  /* About */
  .about-section {
    padding: 3rem 1.25rem;
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-heading { font-size: 40px; }
  .about-body { font-size: 13px; }
  .edu-item { flex-direction: column; gap: 0.2rem; }
  .about-tool-row { flex-direction: column; gap: 0.4rem; }

  /* Contact */
  .contact-section {
    padding: 3rem 1.25rem;
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .contact-heading { font-size: 34px; }
  .contact-value { font-size: 14px; }
  .contact-icon { width: 72px; font-size: 10px; }

  /* Hero skill groups: hide on mobile */
  .skill-groups { display: none; }

  /* Footer */
  footer {
    padding: 1.5rem 1.25rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* === SMALL MOBILE (max 480px) === */
@media (max-width: 480px) {
  .hero-title { font-size: clamp(28px, 10vw, 44px); }
  .hero-sub { font-size: clamp(16px, 6vw, 22px); }
  .about-heading { font-size: 34px; }
  .contact-heading { font-size: 28px; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .stat-item { padding: 0.75rem 0.9rem; }
}
