/* AGI Academy - Design System */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-soft: #f1f5f9;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  --border: #e2e8f0;
  --border-soft: #f1f5f9;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 4px 12px rgba(15,23,42,.08);
  --shadow-md: 0 8px 24px rgba(15,23,42,.10);
  --shadow-lg: 0 16px 48px rgba(15,23,42,.12);
  --shadow-xl: 0 24px 64px rgba(15,23,42,.16);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --gradient-primary: linear-gradient(135deg,#2563eb,#7c3aed);
  --gradient-accent: linear-gradient(135deg,#f59e0b,#ef4444);
  --gradient-bg: linear-gradient(180deg,#eff6ff 0%,#ffffff 60%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; outline: none; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 920px; margin: 0 auto; padding: 0 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius); font-weight: 600; font-size: 14px; transition: all .2s; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,.3); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.4); }
.btn-secondary { background: var(--bg-alt); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-soft); }
.btn-accent { background: var(--gradient-accent); color: #fff; box-shadow: 0 4px 14px rgba(245,158,11,.35); }
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,158,11,.5); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 15px; transition: all .2s; background: var(--bg); }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 6px; }

/* Cards */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; transition: all .2s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-accent { background: var(--accent-light); color: #b45309; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-gray { background: var(--bg-soft); color: var(--text-muted); }

/* Navbar */
.navbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; height: 72px; gap: 36px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 23px; flex-shrink: 0; }
.nav-logo-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 17px; box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.nav-logo-text { display: flex; flex-direction: column; line-height: 1; }
.nav-logo-text small { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.nav-links { display: flex; gap: 32px; flex: 1; }
.nav-links a { font-size: 16px; color: var(--gray-700); font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
.nav-toggle { display: none; font-size: 22px; padding: 8px; }

/* Sections */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-title { font-size: clamp(28px,4vw,40px); font-weight: 800; text-align: center; margin-bottom: 12px; letter-spacing: -0.02em; }
.section-desc { font-size: 16px; color: var(--text-muted); text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.section-header .section-title { text-align: left; margin: 0; }
.section-header .section-desc { text-align: left; margin: 8px 0 0; }

/* Grid */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Utility */
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 12px 24px; background: var(--gray-900); color: #fff; border-radius: var(--radius); font-size: 14px; z-index: 9999; box-shadow: var(--shadow-md); animation: slideDown .3s ease-out; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideDown { from { transform: translate(-50%, -100%); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.active { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-xl); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { font-size: 22px; color: var(--text-muted); padding: 4px 8px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }

/* Loading */
.loading { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--gray-100), var(--gray-200), var(--gray-100)); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-inner { gap: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .container { padding: 0 16px; }
}

/* Navbar with mega menu */
.navbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.95); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; height: 64px; gap: 28px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.nav-logo-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 16px; box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.nav-logo-text { display: flex; flex-direction: column; line-height: 1; }
.nav-logo-text small { font-size: 10px; color: var(--text-muted); font-weight: 500; margin-top: 2px; letter-spacing: 0.5px; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-item { position: relative; }
.nav-item > a, .nav-item > .nav-trigger { font-size: 14px; color: var(--gray-700); font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: all .2s; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.nav-item > a:hover, .nav-item > .nav-trigger:hover { color: var(--gray-900); background: var(--bg-soft); }
.nav-item.highlight > a, .nav-item.highlight > .nav-trigger { color: var(--primary); font-weight: 700; background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(124,58,237,.08)); }
.nav-item[data-dropdown] > .nav-trigger .caret { color: var(--gray-500); font-size: 9px; opacity: .8; }
.nav-item .caret { font-size: 10px; transition: transform .2s; }
.nav-item.open .caret { transform: rotate(180deg); }

.nav-item.has-dropdown { position: relative; }
.nav-item.has-dropdown::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; pointer-events: auto; }
.nav-dropdown { position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 8px; opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 200; pointer-events: none; }
.nav-item.open .nav-dropdown { opacity: 1; visibility: visible; pointer-events: auto; }
.nav-dropdown a { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 8px; transition: background .15s; }
.nav-dropdown a:hover { background: var(--bg-soft); }
.nav-dropdown a strong { font-size: 14px; color: var(--text); margin-bottom: 2px; }
.nav-dropdown a span { font-size: 12px; color: var(--text-muted); }

.nav-mega { position: absolute; top: calc(100% + 4px); left: 50%; transform: translate(-50%, -4px); width: 720px; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 24px; opacity: 0; visibility: hidden; transition: all .15s; z-index: 200; }
.nav-item.open .nav-mega { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.nav-mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nav-mega-item { padding: 14px; border-radius: 10px; transition: all .15s; }
.nav-mega-item:hover { background: var(--bg-soft); transform: translateY(-1px); }
.nav-mega-item .icon { width: 36px; height: 36px; border-radius: 8px; background: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 8px; }
.nav-mega-item.green .icon { background: linear-gradient(135deg,#10b981,#059669); }
.nav-mega-item.orange .icon { background: linear-gradient(135deg,#f59e0b,#ef4444); }
.nav-mega-item.purple .icon { background: linear-gradient(135deg,#7c3aed,#ec4899); }
.nav-mega-item.cyan .icon { background: linear-gradient(135deg,#06b6d4,#3b82f6); }
.nav-mega-item.pink .icon { background: linear-gradient(135deg,#ec4899,#f43f5e); }
.nav-mega-item strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.nav-mega-item small { display: block; font-size: 12px; color: var(--text-muted); }

.nav-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.nav-campus-cta { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 7px 14px; border-radius: 999px; background: linear-gradient(135deg, #10b981, #059669); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .05em; box-shadow: 0 6px 18px rgba(16,185,129,.25); transition: transform .2s, box-shadow .2s; flex-shrink: 0; }
.nav-campus-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16,185,129,.35); color: #fff; }
.nav-campus-cta.active { box-shadow: 0 0 0 2px rgba(16,185,129,.3), 0 6px 18px rgba(16,185,129,.25); }
.nav-campus-cta .nav-campus-icon { font-size: 14px; line-height: 1; }
.nav-campus-cta .nav-campus-label { white-space: nowrap; }
.nav-toggle { display: none; font-size: 22px; padding: 8px; }

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-links.mobile-open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: #fff; padding: 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); gap: 4px; }
  .nav-mega { display: none; }
  .nav-dropdown { position: static; box-shadow: none; border: none; padding: 0 0 0 16px; }
  .nav-toggle { display: block; }
}
