body {
  font-family: Arial, sans-serif;
  margin: 20px;
  padding: 20px;
  line-height: 1.6;
}

h1 {
  font-size: 24px;
  padding: 10px;
  background-color: #007bff;
  color: #fff;
  margin-top: 40px;
  margin-bottom: 20px;
}

h2 {
  font-size: 20px;
  padding: 8px;
  background-color: #f8f9fa;
  color: #000;
  margin-top: 30px;
  margin-bottom: 10px;
}

a {
  display: block;
  color: #007bff;
  text-decoration: none;
  margin-bottom: 10px;
}

a:hover {
  text-decoration: underline;
}

p {
  margin: 10px 0;
}

.link-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.inline-links a {
  display: inline-block;
  margin-right: 4px;
  text-decoration: none;
}

.inline-links a:last-child {
  margin-right: 0;
}

/* 懸浮導覽列樣式 */
html {
  scroll-behavior: smooth;
}

.container h1 {
  scroll-margin-top: 75px;
}

.floating-nav {
  position: sticky;
  top: 10px;
  z-index: 1000;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 14px;
  margin: 15px 0 25px 0;
  border-radius: 12px;
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

.nav-header {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-title {
  font-weight: bold;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
}

.chapter-dropdown {
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background-color: #fff;
  color: #495057;
  cursor: pointer;
  outline: none;
  max-width: 140px;
}

.chapter-dropdown:focus {
  border-color: #007bff;
}

.nav-scroll-container {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-scroll-container::-webkit-scrollbar {
  display: none;
}

.nav-items {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px;
  padding: 2px 0;
}

.nav-scroll-container a.nav-pill {
  display: inline-block !important;
  margin-bottom: 0 !important;
  padding: 5px 12px;
  font-size: 13px;
  color: #495057;
  background: #f1f3f5;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.nav-scroll-container a.nav-pill:hover {
  background: #e2e6ea;
  color: #007bff;
  text-decoration: none;
}

.nav-scroll-container a.nav-pill.active {
  background: #007bff;
  color: #fff;
  font-weight: bold;
}

.nav-top-btn {
  flex-shrink: 0;
  background: #f8f9fa;
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-top-btn:hover {
  background: #e9ecef;
  color: #007bff;
  border-color: #007bff;
}

@media (max-width: 600px) {
  .nav-title {
    display: none;
  }
  .chapter-dropdown {
    max-width: 110px;
    font-size: 12px;
  }
  .floating-nav {
    padding: 6px 8px;
    gap: 6px;
  }
}
