/* ============================================
   长期照护师教育管理平台 - 公共样式
   Common Styles for All Pages
   ============================================ */

/* ----- Base Reset ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: #f8fafc;
  color: #1f2937;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ----- CSS Variables (Backward Compatibility) ----- */
:root {
  --primary-color: #1e3a8a;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #06b6d4;
  --success: #16a34a;
  --error: #dc2626;
  --danger: #dc2626;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow: 0 4px 16px rgba(30,58,138,0.07);
  --shadow-sm: 0 2px 8px rgba(30,58,138,0.05);
  --text-dark: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --bg-gray: #f9fafb;
  --transition: all 0.3s ease;
}

/* ----- Navbar (Default: White/Inner Page Style) ----- */
/* Override Bootstrap .navbar defaults */
.navbar {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: all 0.4s ease;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 20px rgba(30,58,138,0.1);
  display: block !important;
  padding: 0 !important;
}

/* Navbar layout: pure CSS, not relying on Tailwind flex/grid */
.yb-nav-row {
  display: flex;
  align-items: center;
  height: 64px;
}
.yb-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.yb-nav-left .yb-nav-links {
  display: none;
  align-items: center;
  gap: 32px;
}
.yb-nav-spacer {
  flex: 1;
  min-width: 0;
}
.yb-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
/* Desktop nav visible, mobile button hidden */
@media (min-width: 1024px) {
  .yb-nav-left { gap: 32px; }
  .yb-nav-left .yb-nav-links { display: flex !important; }
  .yb-nav-menu-btn { display: none !important; }
}
/* Mobile: hide desktop-only items */
@media (max-width: 1023px) {
  .yb-nav-left .yb-nav-links { display: none !important; }
  .yb-nav-menu-btn { display: block !important; }
  .yb-desktop-only { display: none !important; }
}
@media (max-width: 767px) {
  .yb-md-only { display: none !important; }
}
@media (min-width: 640px) {
  .yb-sm-hide { display: none !important; }
}
@media (max-width: 639px) {
  .yb-sm-show { display: none !important; }
}

.nav-link {
  color: #1e3a8a;
  transition: color 0.3s;
  font-weight: 500;
}
.nav-link:hover { color: #06b6d4; }

.logo-text {
  color: #1e3a8a;
  font-weight: 700;
  font-size: 1.1rem;
  transition: color 0.4s;
}

/* Index page navbar: transparent by default */
.navbar.navbar-transparent {
  background: transparent;
  box-shadow: none;
}
.navbar.navbar-transparent .nav-link { color: rgba(255,255,255,0.9); }
.navbar.navbar-transparent .logo-text { color: #fff; }
.navbar.navbar-transparent #orgLink { color: #fff; }
.navbar.navbar-transparent #mobileLoginBtn { color: #fff; }
.navbar.navbar-transparent #mobileMenuBtn { color: #fff; }

/* All pages navbar default blue background (pseudo-element for consistent look) */
.navbar.navbar-transparent::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  z-index: -1;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.navbar.navbar-transparent.scrolled::before {
  opacity: 0;
}

/* Navbar scrolled state (white background) */
.navbar.scrolled {
  background: rgba(255,255,255,0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 20px rgba(30,58,138,0.1);
}
.navbar.scrolled .nav-link { color: #1e3a8a !important; }
.navbar.scrolled .logo-text { color: #1e3a8a !important; }
.navbar.scrolled #orgLink { color: #1e3a8a !important; }
.navbar.scrolled #mobileLoginBtn { color: #1e3a8a !important; }
.navbar.scrolled #mobileMenuBtn { color: #1e3a8a !important; }

/* ----- Mobile Bottom Nav ----- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  z-index: 1001;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 6px;
  color: #9ca3af;
  font-size: 0.7rem;
  position: relative;
  transition: all 0.3s;
  cursor: pointer;
}
.mobile-bottom-nav .nav-item i { font-size: 1.15rem; margin-bottom: 2px; }
.mobile-bottom-nav .nav-item.active { color: #1e3a8a; }
.mobile-bottom-nav .nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 2px;
  background: #1e3a8a;
  border-radius: 0 0 2px 2px;
}

/* ----- Toast ----- */
.toast-container {
  position: fixed;
  top: 100px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: none;
}
.toast-container.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast-box {
  padding: 14px 28px;
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(12px);
}
.toast-info { background: rgba(30,58,138,0.92); }
.toast-success { background: rgba(21,128,61,0.92); }
.toast-warning { background: rgba(217,119,6,0.92); }
.toast-error { background: rgba(185,28,28,0.92); }

/* ----- Mobile Menu Overlay ----- */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,58,138,0.98);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}
.mobile-menu-overlay.open { opacity: 1; visibility: visible; }
.mobile-menu-overlay a {
  color: #fff;
  font-size: 1.25rem;
  padding: 14px 0;
  display: block;
  text-decoration: none;
  transition: color 0.3s;
}
.mobile-menu-overlay a:hover { color: #06b6d4; }

/* ----- Modal ----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 16px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  transform: translateY(20px) scale(0.98);
  transition: all 0.3s ease;
}
.modal-overlay.active .modal-box { transform: translateY(0) scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
}
.modal-header h3 { color: #fff; font-weight: 700; font-size: 1.1rem; }
.modal-header button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-header button:hover { background: rgba(255,255,255,0.3); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(85vh - 60px);
}
.modal-body h4 {
  color: #1e3a8a;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-body h4:first-child { margin-top: 0; }
.modal-body p, .modal-body li { color: #475569; font-size: 0.85rem; line-height: 1.7; }
.modal-body ul { list-style: none; padding-left: 0; }
.modal-body ul li { padding-left: 16px; position: relative; }
.modal-body ul li::before {
  content: '';
  position: absolute;
  left: 4px; top: 10px;
  width: 5px; height: 5px;
  background: #3b82f6;
  border-radius: 50%;
}
.modal-body .highlight-box {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
}
.modal-body .highlight-box p { color: #1e3a8a; font-weight: 500; font-size: 0.8rem; margin: 0; }

/* ----- Footer ----- */
.footer { background: #0f172a; color: #94a3b8; }
.footer a { color: #94a3b8; transition: color 0.3s; text-decoration: none; }
.footer a:hover { color: #06b6d4; }

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ----- Scroll Animations ----- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }

/* ----- Shared Components ----- */

/* Tags */
.tag-success {
  background: #dcfce7;
  color: #166534;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.tag-warning {
  background: #ffedd5;
  color: #9a3412;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.tag-info {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

/* Inner Banner (used on courses, practice, exam, notice, notice-detail) */
.inner-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  padding-top: 100px;
  padding-bottom: 56px;
  position: relative;
  overflow: hidden;
}
.inner-banner::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");
}

/* Course sidebar item */
.course-sidebar-item {
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.3s;
  border-left: 3px solid transparent;
  border-radius: 0 10px 10px 0;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: #4b5563;
}
.course-sidebar-item:hover { background: #eff6ff; color: #1e3a8a; }
.course-sidebar-item.active {
  background: #eff6ff;
  color: #1e3a8a;
  border-left-color: #1e3a8a;
  font-weight: 600;
}

/* Course tab */
.course-tab {
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
  color: #6b7280;
  background: #f3f4f6;
  border: none;
  margin-right: 8px;
}
.course-tab.active { background: #1e3a8a; color: #fff; }

/* Course card */
.course-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(30,58,138,0.07);
  transition: all 0.35s ease;
  border: 1px solid #f3f4f6;
}
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(30,58,138,0.13);
}
.course-cover {
  height: 150px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.course-cover svg { width: 56px; height: 56px; opacity: 0.85; }

/* Filter pill */
.filter-pill {
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.8rem;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.filter-pill.active { background: #1e3a8a; color: #fff; border-color: #1e3a8a; }
.filter-pill:hover:not(.active) { background: #eff6ff; color: #1e3a8a; }

/* Exam card */
.exam-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(30,58,138,0.07);
  border: 1px solid #f3f4f6;
  transition: all 0.35s ease;
}
.exam-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(30,58,138,0.12);
}
.status-tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-open { background: #dcfce7; color: #166534; }
.status-soon { background: #fef3c7; color: #92400e; }
.status-closed { background: #f1f5f9; color: #64748b; }

/* Filter button */
.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: white;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.875rem;
}
.filter-btn:hover, .filter-btn.active {
  border-color: #1e3a8a;
  color: #1e3a8a;
  background: #eff6ff;
}

/* Timeline step */
.timeline-step {
  text-align: center;
  position: relative;
  flex: 1;
}
.timeline-step::after {
  content: '';
  position: absolute;
  top: 28px; left: 60%;
  width: 80%; height: 2px;
  background: linear-gradient(90deg, #dbeafe, #bfdbfe);
}
.timeline-step:last-child::after { display: none; }
.timeline-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 8px 24px rgba(30,58,138,0.25);
  position: relative;
  z-index: 2;
}

/* Progress bar animation */
@keyframes progressGrow { from { width: 0; } to { width: var(--target-width); } }
.progress-animated { animation: progressGrow 1.5s ease-out forwards; }

/* Radar animation */
@keyframes radarExpand { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.radar-animate { animation: radarExpand 1s ease-out forwards; }

/* Scrollbar hide */
.hide-scroll::-webkit-scrollbar { display: none; }
.hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* ----- Responsive Breakpoints ----- */
@media (max-width: 767px) {
  .mobile-bottom-nav { display: flex; }
  body { padding-bottom: 70px; }
  .inner-banner { padding-top: 64px; padding-bottom: 24px; }
  .timeline-step::after { display: none; }
  .timeline-container { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 2rem 0.75rem; }
  .course-sidebar-desktop { display: none !important; }
  .course-filter-mobile { display: flex !important; }
  .course-cover { height: 110px; }
  .filter-pill { padding: 5px 12px; font-size: 0.75rem; }
  .course-tab { padding: 6px 14px; font-size: 0.8rem; margin-right: 6px; }
}
@media (min-width: 768px) {
  .course-filter-mobile { display: none !important; }
  .mobile-menu-btn { display: none !important; }
}
@media (max-width: 1023px) {
  .desktop-nav { display: none !important; }
}
@media (min-width: 1024px) {
  .mobile-menu-btn { display: none !important; }
}

/* ----- Tailwind Custom Color Utilities ----- */
.text-primary { color: #1e3a8a; }
.bg-primary { background-color: #1e3a8a; }
.border-primary { border-color: #1e3a8a; }
.text-secondary { color: #06b6d4; }
.bg-secondary { background-color: #06b6d4; }
.border-secondary { border-color: #06b6d4; }
.text-accent { color: #3b82f6; }
.bg-accent { background-color: #3b82f6; }
.border-accent { border-color: #3b82f6; }

.hover\:text-primary:hover { color: #1e3a8a; }
.hover\:bg-primary:hover { background-color: #1e3a8a; }
.hover\:border-primary:hover { border-color: #1e3a8a; }
.hover\:text-secondary:hover { color: #06b6d4; }
.hover\:bg-secondary:hover { background-color: #06b6d4; }
.hover\:border-secondary:hover { border-color: #06b6d4; }
.hover\:text-accent:hover { color: #3b82f6; }
.hover\:bg-accent:hover { background-color: #3b82f6; }
.hover\:border-accent:hover { border-color: #3b82f6; }

.bg-primary\/5 { background-color: rgba(30, 58, 138, 0.05); }
.bg-primary\/10 { background-color: rgba(30, 58, 138, 0.1); }
.bg-primary\/20 { background-color: rgba(30, 58, 138, 0.2); }

/* ============================================
   首页特有样式 (Homepage Specific Styles)
   ============================================ */

/* Scroll animations */
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }

/* ECG Canvas */
#ecgCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* Hero */
.hero-section { position: relative; background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%); min-height: 600px; padding-top: 80px; overflow: hidden; }
.hero-content { position: relative; z-index: 2; }
.tag-badge { display: inline-block; background: rgba(255,255,255,0.18); backdrop-filter: blur(8px); color: #fff; padding: 6px 16px; border-radius: 999px; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.25); }

/* Radar panel */
.radar-panel { background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-radius: 16px; padding: 16px; box-shadow: 0 16px 48px rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.3); }

/* Quick entry cards */
.quick-card { background: #fff; border-radius: 16px; padding: 28px 20px; text-align: center; box-shadow: 0 4px 20px rgba(30,58,138,0.08); transition: all 0.35s ease; border: 1px solid #f3f4f6; cursor: pointer; }
.quick-card:hover { transform: translateY(-8px); box-shadow: 0 16px 40px rgba(30,58,138,0.15); border-color: #dbeafe; }
.quick-icon { width: 60px; height: 60px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 1.5rem; }

/* Notice marquee */
.notice-bar { background: linear-gradient(90deg, #1e3a8a, #1d4ed8); border-radius: 12px; overflow: hidden; position: relative; }
.marquee-track { display: flex; animation: marquee 20s linear infinite; white-space: nowrap; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.marquee-item { display: inline-flex; align-items: center; padding: 0 40px; color: #fff; font-size: 0.9rem; }

/* Stats section */
.stats-section { background: linear-gradient(135deg, #1e3a8a, #1d4ed8); position: relative; overflow: hidden; }
.stats-section::before { content: ''; position: absolute; top: -50%; left: -20%; width: 60%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%); }
.stats-section::after { content: ''; position: absolute; bottom: -50%; right: -20%; width: 60%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%); }
.stat-number { font-size: 2.8rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-label { color: rgba(255,255,255,0.75); font-size: 0.95rem; margin-top: 8px; }

/* Particle canvas */
#particleCanvas { position: absolute; bottom: 0; left: 0; width: 100%; height: 40%; pointer-events: none; z-index: 0; }

/* Homepage responsive */
@media (max-width: 767px) {
  .hero-section { min-height: auto; padding-top: 64px; padding-bottom: 24px; }
  .hero-stats { display: none !important; }
  .stat-number { font-size: 2rem; }
}
