/* --- Reading Progress Bar --- */
#se-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background-color: #1d6296;
  width: 0%;
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* --- Search Modal --- */
#se-search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}
#se-search-modal.open {
  display: flex;
}
#se-search-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(17, 28, 44, 0.4);
  backdrop-filter: blur(4px);
}
#se-search-box {
  position: relative;
  background-color: #ffffff;
  width: 100%;
  max-width: 600px;
  border-radius: 16px;
  box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid #c4c6cd;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  z-index: 101;
  overflow: hidden;
  animation: seSearchSlide 0.25s ease-out;
}
@keyframes seSearchSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
#se-search-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #c4c6cd;
  padding: 12px 16px;
  gap: 12px;
}
#se-search-icon {
  font-family: 'Material Symbols Outlined';
  font-size: 24px;
  color: #74777d;
}
#se-search-input {
  flex: 1;
  border: none;
  font-size: 16px;
  color: #111c2c;
  padding: 8px 0;
  outline: none;
}
#se-search-input::placeholder {
  color: #74777d;
}
#se-search-close {
  font-family: 'Material Symbols Outlined';
  background: none;
  border: none;
  font-size: 24px;
  color: #74777d;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}
#se-search-close:hover {
  background-color: #f0f3ff;
  color: #111c2c;
}
#se-search-results {
  overflow-y: auto;
  padding: 12px;
  flex: 1;
  max-height: 50vh;
}
.se-result-item {
  display: block;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.2s;
  position: relative;
}
.se-result-item:hover, .se-result-item:focus {
  background-color: #f0f3ff;
  outline: none;
}
.se-result-title {
  font-size: 16px;
  font-weight: 600;
  color: #041627;
  margin-bottom: 4px;
}
.se-result-desc {
  font-size: 14px;
  color: #44474c;
  line-height: 1.4;
  margin-bottom: 6px;
}
.se-result-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.se-search-empty {
  text-align: center;
  padding: 40px 20px;
}
.se-search-empty span {
  font-family: 'Material Symbols Outlined';
  color: #74777d;
}
.se-search-empty p {
  margin-top: 12px;
  font-size: 15px;
  color: #44474c;
}
#se-search-footer {
  padding: 12px 16px;
  border-top: 1px solid #c4c6cd;
  background-color: #f9f9ff;
  font-size: 12px;
  color: #74777d;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#se-search-footer kbd {
  background-color: #ffffff;
  border: 1px solid #c4c6cd;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
#se-toc-container {
  margin-bottom: 24px;
}
#se-toc {
  background-color: #f9f9ff;
  border: 1px solid #c4c6cd;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 32px;
}
.se-toc-title {
  font-size: 18px;
  font-weight: 700;
  color: #041627;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid #c4c6cd;
  padding-bottom: 8px;
}
.se-toc-title span {
  color: #1d6296;
}
.se-toc-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.se-toc-link {
  font-size: 15px;
  color: #44474c;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
  line-height: 1.4;
}
.se-toc-link:hover, .se-toc-link.active {
  color: #1d6296;
  font-weight: 600;
}
.se-toc-sub {
  padding-left: 16px;
  border-left: 2px solid #cfe5ff;
}
.se-toc-sub .se-toc-link {
  font-size: 14px;
}
@media (min-width: 1024px) {
  #se-toc-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    width: 260px;
    margin-right: 32px;
  }
}
.se-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}
@media (min-width: 640px) {
  .se-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .se-related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.se-related-card {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border: 1px solid #c4c6cd;
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.se-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0px 8px 24px rgba(26, 43, 60, 0.08);
}
.se-related-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #1d6296;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.se-related-title {
  font-size: 16px;
  font-weight: 700;
  color: #041627;
  margin-bottom: 8px;
  line-height: 1.3;
}
.se-related-desc {
  font-size: 13px;
  color: #44474c;
  line-height: 1.4;
  margin-bottom: 16px;
}
.se-related-link {
  font-size: 13px;
  font-weight: 600;
  color: #1d6296;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.se-related-link span {
  font-size: 16px;
}
.se-no-results {
  text-align: center;
  padding: 48px 24px;
  background-color: #ffffff;
  border: 1px solid #c4c6cd;
  border-radius: 16px;
  margin-top: 16px;
}
.se-no-results span {
  font-family: 'Material Symbols Outlined';
  font-size: 48px;
  color: #ba1a1a;
  margin-bottom: 12px;
}
.se-no-results p {
  font-size: 16px;
  color: #44474c;
}