@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Inter:wght@300;400;500;600;700&family=Noto+Serif+SC:wght@400;500;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  /* Colors */
  --navy: #0B192C;        /* Deep academic navy */
  --navy-light: #162B4A;
  --gold: #C5A059;        /* Elegant dull gold */
  --gold-hover: #D6B26A;
  --gold-light: #F2EBDA;
  --white: #FFFFFF;
  --bg-off: #F8F9FA;
  --bg-dark: #050E1A;
  --text-main: #2C3545;
  --text-muted: #64748B;
  --border: #E2E8F0;
  
  /* Fonts */
  --font-serif: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Inter', 'Noto Sans SC', Helvetica, Arial, sans-serif;
  
  /* Radii */
  --r-1: 8px;
  --r-2: 16px;
  --r-full: 9999px;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(12px);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
a, a:hover, a:focus, a:active { text-decoration: none !important; }
body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.gradient-text {
  background: linear-gradient(135deg, var(--gold) 0%, #E2C28E 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 12px 28px;
  border-radius: var(--r-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
}
.btn-gold {
  background-color: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.btn-gold:hover {
  background-color: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(197, 160, 89, 0.3);
}
.btn-outline-white {
  background-color: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn-outline-white:hover {
  border-color: var(--white);
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* --- NAV --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  z-index: 1000;
  transition: all 0.4s ease;
}
.nav.scrolled {
  background: rgba(11, 25, 44, 0.9);
  backdrop-filter: var(--glass-blur);
  height: 64px;
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-logo {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.4);
}
.brand-logo svg { width: 22px; height: 22px; fill: var(--white); }
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}
.brand-name span { color: var(--gold); }

.nav-links { display: flex; gap: 32px; }
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.3s;
}
.nav-link:hover, .nav-link.active { color: var(--gold); }

/* --- HERO --- */
.hero {
  background-color: var(--navy);
  padding: 160px 0 100px;
  min-height: 90vh;
  display: flex; align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(197, 160, 89, 0.1) 0%, transparent 40%),
                    radial-gradient(circle at 80% 70%, rgba(22, 43, 74, 1) 0%, transparent 50%);
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px;
  align-items: center; position: relative; z-index: 2;
}
.hero-content { color: var(--white); }
.hero-tag {
  display: inline-block; padding: 6px 16px; background: rgba(197, 160, 89, 0.15);
  color: var(--gold); border-radius: var(--r-full); font-size: 0.75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 24px;
}
.hero-title {
  color: var(--white); font-size: 4rem; margin-bottom: 24px; line-height: 1.1;
}
.hero-desc {
  font-size: 1.1rem; color: rgba(255, 255, 255, 0.6); max-width: 520px;
  margin-bottom: 40px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; }

.hero-visual {
  display: flex; justify-content: center; align-items: center;
  perspective: 2000px;
}
.book-mockup {
  width: 320px; height: 440px;
  background: var(--white);
  border-radius: 4px 16px 16px 4px;
  box-shadow: -20px 30px 60px rgba(0,0,0,0.5);
  transform: rotateY(-20deg) rotateX(10deg);
  position: relative; overflow: hidden;
  transition: transform 0.6s ease;
}
.book-mockup:hover { transform: rotateY(-10deg) rotateX(5deg) scale(1.02); }
.book-spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 24px;
  background: linear-gradient(90deg, #d1d5db, #f3f4f6);
  border-right: 1px solid rgba(0,0,0,0.1);
}
.book-cover {
  margin-left: 24px; height: 100%; padding: 40px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.bc-logo { font-family: var(--font-serif); font-size: 0.8rem; font-weight: 800; color: var(--navy); }
.bc-title { font-size: 2.2rem; color: var(--navy); line-height: 1.2; }
.bc-subtitle { font-size: 0.7rem; color: var(--gold); font-weight: 700; margin-top: 10px; }
.bc-footer { font-size: 0.6rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 15px; }

/* --- SUBJECTS GRID --- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-off); }
.section-header { text-align: center; margin-bottom: 60px; }
.kicker { color: var(--gold); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; display: block; margin-bottom: 12px; }
.section-title { font-size: 2.5rem; margin-bottom: 20px; }

.resource-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px;
}
.res-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-2); padding: 32px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden; text-decoration: none;
}
.res-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: var(--gold); transform: scaleY(0); transition: transform 0.4s ease;
}
.res-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  border-color: var(--gold);
}
.res-card:hover::before { transform: scaleY(1); }

.res-icon {
  width: 56px; height: 56px; background: var(--bg-off);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 24px; transition: background 0.3s;
}
.res-card:hover .res-icon { background: var(--gold-light); }
.res-code { font-family: var(--font-sans); font-size: 0.75rem; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.res-name { font-size: 1.4rem; color: var(--navy); margin-bottom: 12px; }
.res-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 0.7rem; padding: 4px 10px; background: var(--bg-off); color: var(--text-muted); border-radius: 4px; }

/* --- STATS BAR --- */
.stats-bar {
  background: var(--navy); padding: 60px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; text-align: center; }
.stat-item h3 { color: var(--white); font-size: 2.5rem; margin-bottom: 8px; font-family: var(--font-sans); }
.stat-item p { color: var(--gold); font-size: 0.8rem; text-transform: uppercase; font-weight: 600; }

/* --- PAGE WRAPPERS --- */
.details-page > .container,
.subjects-page > .container, 
.search-page > .container, 
.school-page > .container { 
  padding-bottom: 120px; 
  flex: 1;
}

/* --- FOOTER --- */
.footer { background: var(--bg-dark); color: rgba(255,255,255,0.5); padding: 80px 0 40px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px; margin-bottom: 60px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.8; margin-top: 20px; }
.footer-col h4 { color: var(--white); font-size: 0.9rem; text-transform: uppercase; margin-bottom: 24px; font-family: var(--font-sans); }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul a { color: inherit; text-decoration: none; font-size: 0.85rem; transition: color 0.3s; }
.footer-col ul a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 40px; display: flex; justify-content: space-between; font-size: 0.8rem; }

/* --- BARRAGE --- */
#danmu-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 100; overflow: hidden;
}
.danmu-item {
  position: absolute; white-space: nowrap; font-size: 13px;
  color: rgba(255, 255, 255, 0.4); padding: 6px 16px;
  background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(4px);
  border-radius: var(--r-full); border: 1px solid rgba(255, 255, 255, 0.1);
  animation: moveLeft linear forwards;
  will-change: transform;
}
@keyframes moveLeft { from { transform: translateX(100vw); } to { transform: translateX(-150%); } }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-content { display: flex; flex-direction: column; align-items: center; }
  .hero-title { font-size: 3rem; }
  .hero-visual { margin-top: 40px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-title { font-size: 2.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
}

/* Animations */
.reveal { opacity: 0; transform: translateY(30px); transition: 0.8s ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0); }
