/* 基礎字體設定 - Base Font Settings */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* 焦點樣式整合校友會主題 - Focus Styles with Alumni Theme */
.btn:focus, 
.btn:active:focus, 
.btn-link.nav-link:focus, 
.form-control:focus, 
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(139, 95, 191, 0.5);
}

/* 頁面基礎設定 - Page Base Settings */
html {
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin-bottom: 60px;
  padding-top: 76px; /* 為固定導覽列留出空間 */
}

/* 懶載入樣式 - Lazy Loading Styles */
.lazy-load {
  opacity: 0.6;
  transition: opacity 0.3s ease;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.lazy-load.loaded {
  opacity: 1;
  background: none;
  animation: none;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 回到頂部按鈕 - Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #D8BFD8 0%, #DDA0DD 50%, #BA55D3 100%);
  color: white;
  border-radius: 15px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(186, 85, 211, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  display: none;
  flex-direction: column;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.back-to-top:hover {
  background: linear-gradient(135deg, #BA55D3 0%, #9370DB 50%, #8A2BE2 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(186, 85, 211, 0.6);
  text-decoration: none;
}

.back-to-top i {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.back-to-top-text {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 載入動畫改進 - Loading Animation Improvements */
.loading {
  backdrop-filter: blur(2px);
}

.loading .spinner-border {
  color: #8B5FBF;
}

/* 導覽列調整 - Navbar Adjustments */
.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 下拉選單改進 - Dropdown Menu Improvements */
.dropdown-menu {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(139, 95, 191, 0.15);
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

.dropdown-item {
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: linear-gradient(135deg, rgba(139, 95, 191, 0.1) 0%, rgba(111, 168, 220, 0.1) 100%);
  color: #8B5FBF;
}

/* 頁尾改進 - Footer Improvements */
footer {
  border-top: 1px solid rgba(139, 95, 191, 0.1);
}

footer h5 {
  color: #8B5FBF;
  font-weight: 600;
}

footer .social-links a {
  color: #ffffff;
  transition: color 0.3s ease;
}

    footer .social-links a:hover {
        color: #ffff00;
        background-color: #00ffff;
    }

/* 響應式圖片 - Responsive Images */
img {
  max-width: 100%;
  height: auto;
}

/* 無障礙改進 - Accessibility Improvements */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 跳過連結 - Skip Links */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #8B5FBF;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1001;
}

.skip-link:focus {
  top: 0;
  color: white;
}