/* ===== CSS Variables ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #06b6d4;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: .3s cubic-bezier(.4,0,.2,1);
  --max-width: 1100px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ===== Navigation ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.navbar .container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar .logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar .nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.menu-toggle svg { width: 24px; height: 24px; }

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #06b6d4 100%);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero .container {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 3px solid rgba(255,255,255,.4);
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -.02em;
}

.hero .subtitle {
  font-size: 1.1rem;
  opacity: .9;
  margin-bottom: 4px;
}

.hero .school {
  font-size: .95rem;
  opacity: .75;
  margin-bottom: 32px;
}

.hero .tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero .tag {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .85rem;
  backdrop-filter: blur(4px);
  transition: all var(--transition);
}

.hero .tag:hover {
  background: rgba(255,255,255,.25);
  transform: translateY(-1px);
}

/* ===== Section ===== */
.section {
  padding: 64px 24px;
}

.section .container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ===== Course Grid ===== */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.course-card .card-icon {
  height: 8px;
  width: 100%;
}

.course-card .card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-card .card-emoji {
  font-size: 2rem;
  margin-bottom: 12px;
}

.course-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.course-card .card-desc {
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.course-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.course-card .card-status {
  font-size: .8rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.status-progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-coming {
  background: #f1f5f9;
  color: #64748b;
}

.course-card .card-link {
  font-size: .85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.course-card .card-link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}

.course-card:hover .card-link svg {
  transform: translateX(3px);
}

/* ===== Course Detail Page ===== */
.page-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 48px 24px;
  text-align: center;
}

.page-hero .container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-hero .breadcrumb {
  font-size: .85rem;
  opacity: .7;
  margin-bottom: 16px;
}

.page-hero .breadcrumb a {
  color: #fff;
  opacity: .8;
}

.page-hero .breadcrumb a:hover {
  opacity: 1;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-hero .page-desc {
  opacity: .8;
  font-size: 1rem;
}

.course-content {
  padding: 48px 24px;
}

.course-content .container {
  max-width: 800px;
  margin: 0 auto;
}

.content-placeholder {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 64px 32px;
  text-align: center;
  color: var(--text-secondary);
}

.content-placeholder .placeholder-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: .5;
}

.content-placeholder h3 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 8px;
}

.content-placeholder p {
  font-size: .9rem;
  line-height: 1.6;
}

/* ===== Footer ===== */
.footer {
  margin-top: auto;
  background: var(--text);
  color: rgba(255,255,255,.6);
  padding: 32px 24px;
  text-align: center;
  font-size: .85rem;
}

.footer a {
  color: rgba(255,255,255,.8);
}

.footer a:hover {
  color: #fff;
}

.footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .navbar .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .navbar .nav-links.open { display: flex; }

  .navbar .nav-links a {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
  }

  .hero { padding: 56px 24px; }
  .hero h1 { font-size: 1.75rem; }

  .section { padding: 48px 16px; }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .page-hero h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .hero .subtitle { font-size: 1rem; }
  .section-header h2 { font-size: 1.4rem; }
}
