/* ===== Apple Design System Override ===== */
:root {
  --white: #ffffff;
  --gray-50: #f5f5f7;
  --gray-100: #f5f5f7;
  --gray-200: #e8e8ed;
  --gray-300: #d2d2d7;
  --gray-400: #86868b;
  --gray-500: #6e6e73;
  --gray-600: #424245;
  --gray-700: #1d1d1f;
  --gray-800: #1d1d1f;
  --gray-900: #000000;
  --black: #000000;
  --line-color: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.08);
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --font-cn: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-en: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; }
body {
  background: #f5f5f7;
  color: #1d1d1f;
  font-family: var(--font-cn);
  overflow-x: hidden;
}
::selection { background: rgba(0, 113, 227, 0.2); color: #000; }

/* Background pattern becomes very subtle */
body::before {
  opacity: 0.25;
  background-size: 32px 32px;
}

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #0071e3, #42a5f5);
  box-shadow: 0 0 10px rgba(0, 113, 227, 0.4);
  z-index: 1001;
  pointer-events: none;
}

/* ===== Navigation (glass) ===== */
.nav {
  height: 52px;
  padding: 0 max(1.2rem, calc((100vw - 1120px) / 2));
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transition: background 0.3s, box-shadow 0.3s;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.nav-logo span {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.nav-links {
  gap: 0.35rem;
  background: transparent;
  border: none;
  padding: 0;
}
.nav-links a {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: #6e6e73;
  transition: all 0.25s ease;
}
.nav-links a:hover,
.nav-links a.active {
  background: rgba(0, 0, 0, 0.05);
  color: #1d1d1f;
}

/* ===== Hero ===== */
.hero {
  margin-top: 52px;
  padding: 0 2rem;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
}
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.7;
  pointer-events: none;
}
.hero-svg {
  position: relative;
  z-index: 1;
  max-width: min(760px, 92vw);
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.08));
  opacity: 0;
  animation: heroIn 1s 0.05s cubic-bezier(0.16, 1, 0.3, 1) forwards,
             float 6s ease-in-out infinite 1s;
}
.hero h1 {
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #1d1d1f 0%, #535355 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  animation: heroIn 0.9s 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero p {
  position: relative;
  z-index: 1;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: #6e6e73;
  max-width: 620px;
  opacity: 0;
  animation: heroIn 0.9s 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== Entry Cards (Bento) ===== */
.entry-grid {
  max-width: 980px;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 3rem auto 4rem;
  padding: 0;
}
.entry-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  padding: 2rem 1.2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s;
}
.entry-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--x, 50%) var(--y, 50%), rgba(0, 113, 227, 0.1), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.entry-card:hover::before { opacity: 1; }
.entry-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.09);
}
.entry-card svg { width: 44px; height: 44px; color: #1d1d1f; margin-bottom: 1rem; }
.entry-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.entry-card p { font-size: 0.85rem; color: #6e6e73; }

/* ===== Sections ===== */
.section {
  padding: 6rem 2rem;
  border-bottom: none;
}
.section:not(:last-child) { border-bottom: none; }
.section-header { margin-bottom: 3rem; }
.section-header svg { width: 44px; height: 44px; color: #1d1d1f; margin-bottom: 0.75rem; }
.section-title {
  -webkit-text-fill-color: transparent;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #000000 0%, #434344 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-subtitle { font-size: 1.05rem; color: #6e6e73; margin-bottom: 0; }

/* ===== Tabs (segmented pill) ===== */
.tab-bar {
  flex-wrap: wrap;
  display: flex;
  justify-content: center;
  background: #e8e8ed;
  padding: 0.35rem;
  border-radius: 999px;
  margin-bottom: 2.5rem;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.tab-btn {
  background: transparent;
  border-radius: 999px;
  padding: 0.55rem 1.5rem;
  font-size: 0.92rem;
  color: #6e6e73;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}
.tab-btn.active {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.sub-tab-bar { gap: 0.3rem; margin-bottom: 1.5rem; }
.sub-tab-btn {
  background: transparent;
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  color: #6e6e73;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.sub-tab-btn.active { background: #ffffff; color: #1d1d1f; border-color: #d2d2d7; }

/* ===== App Cards ===== */
.apps-grid { gap: 1.25rem; }
.apps-grid[data-cat="learn"],
.apps-grid[data-cat="campus"] { grid-template-columns: repeat(3, 1fr); }
.app-card {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 1.6rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}
.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--x, 50%) var(--y, 50%), rgba(0, 113, 227, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.app-card:hover::before { opacity: 1; }
.app-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}
.app-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5f5f7, #e8e8ed);
  color: #1d1d1f;
}
.app-card-icon svg { width: 24px; height: 24px; }
.app-card-title { font-size: 1.05rem; }
.app-card-desc { color: #6e6e73; }
.app-tag {
  background: #f5f5f7;
  color: #6e6e73;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}
.app-link {
  background: #0071e3;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  transition: transform 0.2s, background 0.2s;
}
.app-link:hover { background: #0077ed; transform: scale(1.03); }
.app-link svg { stroke: #ffffff; }
.app-steps { border-left-color: #e8e8ed; }
.app-step::before { background: #e8e8ed; color: #6e6e73; }

/* ===== Food Cards ===== */
.food-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
#food-canteen1 .food-grid { grid-template-columns: repeat(3, 1fr); }
.food-card {
  background: #ffffff;
  border-radius: 28px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
  transition: transform 0.4s, box-shadow 0.3s;
}
.food-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.08);
}
.food-card-img {
  height: 200px;
  overflow: hidden;
}
.food-card-img img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.food-card:hover .food-card-img img { transform: scale(1.08); }
.food-card-body { padding: 1.25rem 1.5rem 1.5rem; }
.food-card-name { font-size: 1.1rem; }
.food-card-info,
.food-card-tip { color: #6e6e73; }

/* ===== Location Cards ===== */
.loc-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.loc-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 1.6rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s, box-shadow 0.3s;
}
.loc-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
}
.loc-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #f5f5f7;
  color: #1d1d1f;
  margin-bottom: 0.8rem;
}
.loc-card-title { font-size: 1.05rem; }
.loc-card-hours,
.loc-card-note { color: #6e6e73; }
.loc-card-route {
  background: #f5f5f7;
  color: #1d1d1f;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  transition: background 0.2s;
}
.loc-card-route:hover { background: #e8e8ed; }

/* ===== Campus Map ===== */
.campus-map {
  background: #ffffff;
  border-radius: 28px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
}

/* ===== FAQ ===== */
.faq-search input {
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 16px;
  padding: 0.9rem 1rem 0.9rem 2.6rem;
  font-size: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}
.faq-search input:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}
.faq-cat-btn {
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  color: #6e6e73;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s;
}
.faq-cat-btn.active { border-color: #d2d2d7; color: #1d1d1f; }
.faq-item {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 20px;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s;
}
.faq-item:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05); }
.faq-q { padding: 1.1rem 1.4rem; font-size: 1rem; }
.faq-q:hover { background: rgba(0, 0, 0, 0.01); }
.faq-a { font-size: 0.92rem; color: #6e6e73; }

/* ===== Footer ===== */
.footer {
  border-top: none;
  padding: 4rem 2rem 2.5rem;
  color: #86868b;
}
.footer-deco svg { color: #d2d2d7; transition: transform 0.3s, color 0.3s; }
.footer-deco svg:hover { color: #0071e3; transform: translateY(-4px); }

/* ===== Back to Top ===== */
.back-top {
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  color: #1d1d1f;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
.back-top:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ===== Fish popup glass ===== */
.fish-popup {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

/* ===== Reveal animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.revealed { opacity: 1; transform: none; }

.stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.stagger.revealed > * { opacity: 1; transform: none; }
.stagger.revealed > *:nth-child(1) { transition-delay: 0ms; }
.stagger.revealed > *:nth-child(2) { transition-delay: 60ms; }
.stagger.revealed > *:nth-child(3) { transition-delay: 120ms; }
.stagger.revealed > *:nth-child(4) { transition-delay: 180ms; }
.stagger.revealed > *:nth-child(5) { transition-delay: 240ms; }
.stagger.revealed > *:nth-child(6) { transition-delay: 300ms; }
.stagger.revealed > *:nth-child(7) { transition-delay: 360ms; }
.stagger.revealed > *:nth-child(8) { transition-delay: 420ms; }
.stagger.revealed > *:nth-child(9) { transition-delay: 480ms; }
.stagger.revealed > *:nth-child(10) { transition-delay: 540ms; }
.stagger.revealed > *:nth-child(11) { transition-delay: 600ms; }
.stagger.revealed > *:nth-child(12) { transition-delay: 660ms; }

/* ===== Keyframes ===== */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .entry-grid { grid-template-columns: repeat(2, 1fr); }
  .apps-grid[data-cat="learn"],
  .apps-grid[data-cat="campus"] { grid-template-columns: repeat(2, 1fr); }
  #food-canteen1 .food-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav { padding: 0 1rem; }
  .nav-links { top: 52px; }
  .nav-links.open {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  .hero { min-height: auto; padding: 5rem 1rem 3rem; }
  .hero h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .section { padding: 4rem 1rem; }
  .entry-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .entry-card { padding: 1.5rem 1rem; border-radius: 22px; }
  .apps-grid[data-cat="learn"],
  .apps-grid[data-cat="campus"],
  .food-grid,
  #food-canteen1 .food-grid { grid-template-columns: 1fr; }
  .loc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .entry-grid { grid-template-columns: 1fr; }
  .loc-grid { grid-template-columns: 1fr; }
  .tab-btn { padding: 0.45rem 1rem; font-size: 0.85rem; }
}
