:root {
  /* Academix glassmorphism design tokens */
  --bg: #eef2ff;
  --bg-blob-1: rgba(99, 102, 241, 0.4);   /* indigo */
  --bg-blob-2: rgba(139, 92, 246, 0.35);  /* violet */
  --bg-blob-3: rgba(20, 184, 166, 0.3);   /* teal */
  --surface: rgba(255, 255, 255, 0.55);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --glass-border: 1px solid rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px rgba(99, 102, 241, 0.14);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --teal: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px;
  --shadow-soft: 0 4px 20px rgba(15, 23, 42, 0.06);
  --tabbar-h: 72px;
  --nav-bottom-space: 96px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  overscroll-behavior-y: contain;
  -webkit-user-select: none;
  user-select: none;
}

body { position: relative; overflow: hidden; }

/* Ambient background: base + soft blurred blobs */
.bg-scene {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(160deg, #eef2ff 0%, #f8faff 45%, #eef5ff 100%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; animation: float 26s ease-in-out infinite; }
.blob.b1 { width: 42vmax; height: 42vmax; left: -14vmax; top: -12vmax; background: var(--bg-blob-1); }
.blob.b2 { width: 36vmax; height: 36vmax; right: -12vmax; top: 22vh; background: var(--bg-blob-2); animation-delay: -8s; }
.blob.b3 { width: 30vmax; height: 30vmax; left: 10vw; bottom: -12vmax; background: var(--bg-blob-3); animation-delay: -16s; }
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(6vw,-4vh) scale(1.06); }
  66% { transform: translate(-5vw,5vh) scale(0.96); }
}

#app { position: relative; z-index: 1; height: 100%; overflow-y: auto; overflow-x: hidden; padding-bottom: var(--nav-bottom-space); scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }

.screen { padding: var(--sp-6) var(--sp-5) var(--sp-4); animation: screen-in 0.34s cubic-bezier(.22,.9,.32,1); }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Glass surface */
.glass {
  background: var(--surface);
  border: var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.glass-pad { padding: var(--sp-5); }
.glass-strong { background: var(--surface-strong); }
.pressable { transition: transform .15s ease, opacity .15s ease; }
.pressable:active { transform: scale(0.97); opacity: .92; }

/* Cards */
.card { background: var(--surface); border: var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding: var(--sp-5); margin-bottom: var(--sp-4); }
.hero-card { border-radius: var(--r-xl); background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(139,92,246,.12)); border: 1px solid rgba(255,255,255,.8); padding: var(--sp-6); }

/* Typography */
.h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.h3 { font-size: 16px; font-weight: 600; }
.stat-num { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.muted { color: var(--text-2); }
.muted-3 { color: var(--text-3); }
.small { font-size: 12px; }
.label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.greeting-line { font-size: 15px; color: var(--text-2); font-weight: 500; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-full); padding: 15px 22px;
  font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer;
  min-height: 50px; width: 100%; transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 26px rgba(99,102,241,.35); }
.btn-ghost { background: var(--surface); border: var(--glass-border); color: var(--text); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* Inputs */
.field { width: 100%; background: var(--surface); border: var(--glass-border); border-radius: var(--r-md); padding: 15px var(--sp-4); font-size: 16px; font-family: inherit; color: var(--text); outline: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: border-color .2s, box-shadow .2s; }
.field::placeholder { color: var(--text-3); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.label-floating { gap: 6px; display: flex; flex-direction: column; }
.label-floating .field-label { font-size: 13px; font-weight: 600; color: var(--text-2); padding-left: 4px; }

/* Status chip */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-full); padding: 5px 12px; font-size: 12px; font-weight: 700; }
.chip.teal { color: #047857; background: rgba(16,185,129,.16); }
.chip.amber { color: #b45309; background: rgba(245,158,11,.16); }
.chip.rose { color: #be123c; background: rgba(244,63,94,.15); }
.chip.indigo { color: var(--accent); background: rgba(99,102,241,.14); }

/* Filter chips row */
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 4px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; border: 0; border-radius: var(--r-full); padding: 10px 18px; font-size: 13px; font-weight: 600; font-family: inherit; background: var(--surface); border: var(--glass-border); color: var(--text-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: all .2s; }
.filter-chip.active { background: rgba(99,102,241,.18); color: var(--accent); border-color: rgba(99,102,241,.35); font-weight: 700; }

/* Quick actions */
.quick-actions { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.quick-actions::-webkit-scrollbar { display: none; }
.qa { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 7px; width: 74px; padding: 12px 6px; border-radius: var(--r-md); background: var(--surface); border: var(--glass-border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 11px; font-weight: 600; color: var(--text-2); }
.qa .qa-icon { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: rgba(99,102,241,.12); color: var(--accent); font-size: 20px; }
.qa:nth-child(2n) .qa-icon { background: rgba(20,184,166,.12); color: #0d9488; }
.qa:nth-child(3n) .qa-icon { background: rgba(139,92,246,.12); color: #7c3aed; }

/* Circle progress */
.circle { position: relative; width: 104px; height: 104px; }
.circle svg { transform: rotate(-90deg); }
.circle .ring-bg { stroke: rgba(99,102,241,.14); }
.circle .ring { stroke: url(#grad); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.22,.9,.32,1); }
.circle .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; }

/* Timeline (timetable) */
.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid rgba(15,23,42,.06); }
.tl-item:last-child { border-bottom: 0; }
.tl-time { flex: 0 0 64px; text-align: right; font-size: 14px; font-weight: 700; color: var(--accent); padding-top: 2px; }
.tl-dot { flex: 0 0 12px; display: flex; justify-content: center; position: relative; }
.tl-dot::before { content:''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(99,102,241,.16); margin-top: 5px; }
.tl-dot::after { content:''; position: absolute; top: 22px; bottom: -20px; width: 2px; background: linear-gradient(rgba(99,102,241,.35), rgba(99,102,241,.08)); }
.tl-item:last-child .tl-dot::after { display: none; }
.tl-body .h3 { font-size: 15px; }

/* Notice feed */
.notice { display: flex; gap: var(--sp-4); align-items: flex-start; }
.notice .n-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; }
.notice .n-dot.read { background: transparent; }
.notice .n-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.notice .n-title { font-size: 15px; font-weight: 700; margin: 2px 0 2px; }
.notice .n-prev { font-size: 13px; color: var(--text-2); line-height: 1.45; }

/* List row */
.row { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid rgba(15,23,42,.06); }
.row:last-child { border-bottom: 0; }
.avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.avatar.teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.avatar.violet { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.avatar.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.row .grow { flex: 1; min-width: 0; }
.row .grow .sub { font-size: 13px; color: var(--text-2); }

/* Section header */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: var(--sp-6) 0 var(--sp-3); }
.section-head .h3 { font-size: 16px; }
.section-head .link { font-size: 13px; font-weight: 600; color: var(--accent); }

/* Top header */
.app-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.app-head .logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; box-shadow: 0 6px 16px rgba(99,102,241,.4); }
.head-icon { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface); border: var(--glass-border); color: var(--text-2); font-size: 18px; position: relative; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.head-icon .badge { position: absolute; top: 7px; right: 8px; min-width: 8px; height: 8px; border-radius: 50%; background: var(--rose); border: 2px solid #eef2ff; }

/* Floating bottom nav */
.tabbar { position: fixed; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); height: var(--tabbar-h); display: flex; align-items: center; justify-content: space-around; z-index: 20; border-radius: var(--r-full); background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 14px 40px rgba(99,102,241,.22); backdrop-filter: blur(26px) saturate(1.6); -webkit-backdrop-filter: blur(26px) saturate(1.6); padding: 6px 8px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; font-family: inherit; font-size: 10px; font-weight: 600; color: var(--text-3); cursor: pointer; transition: color .2s; }
.tab .ti { width: 34px; height: 26px; border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; font-size: 18px; transition: all .25s; }
.tab.active { color: var(--accent); }
.tab.active .ti { background: rgba(99,102,241,.16); }

/* Skeleton */
.skel { position: relative; overflow: hidden; border-radius: var(--r-md); background: rgba(148,163,184,.2); min-height: 16px; }
.skel::after { content:''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-card { height: 96px; border-radius: var(--r-lg); margin-bottom: var(--sp-4); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 30px); transform: translate(-50%, 20px); background: rgba(15,23,42,.92); color: #fff; font-size: 13px; font-weight: 600; padding: 12px 18px; border-radius: var(--r-full); opacity: 0; pointer-events: none; transition: all .3s; z-index: 40; max-width: 82vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .blob, .skel::after { animation: none; }
  .screen { animation: none; }
}

/* Error / empty states */
.state { text-align: center; padding: var(--sp-8) var(--sp-6); display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.state .ic { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: var(--surface); border: var(--glass-border); margin-bottom: 4px; }
.state .t { font-size: 17px; font-weight: 700; }
.state .s { font-size: 14px; color: var(--text-2); line-height: 1.5; }