@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;700;800&family=Noto+Serif+SC:wght@500;700;900&display=swap");

:root {
  --hm-bg-1: #040d1e;
  --hm-bg-2: #0a1f3f;
  --hm-bg-3: #102c56;
  --hm-text: #ebf3ff;
  --hm-muted: #a5bbda;
  --hm-line: rgba(196, 224, 255, 0.22);
  --hm-glass: rgba(10, 26, 52, 0.72);
  --hm-glass-strong: rgba(10, 27, 55, 0.9);
  --hm-sky: #50b9ff;
  --hm-teal: #3fe0be;
  --hm-sun: #ffd38c;
  --hm-shadow: 0 22px 62px rgba(2, 8, 20, 0.42);
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--hm-text) !important;
  font-family: "Bricolage Grotesque", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
  background: radial-gradient(circle at 90% -20%, rgba(80, 185, 255, 0.24), transparent 46%),
    radial-gradient(circle at -10% 8%, rgba(63, 224, 190, 0.2), transparent 40%),
    radial-gradient(circle at 50% 122%, rgba(255, 211, 140, 0.1), transparent 42%),
    linear-gradient(132deg, var(--hm-bg-1) 0%, var(--hm-bg-2) 50%, var(--hm-bg-3) 100%) !important;
  background-attachment: scroll !important;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
}

.page {
  background: transparent !important;
}

.page-wrapper {
  margin-top: 88px !important;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  background: linear-gradient(180deg, rgba(5, 15, 32, 0.94), rgba(5, 15, 32, 0.68)) !important;
  border-bottom: 1px solid rgba(196, 224, 255, 0.18);
  box-shadow: 0 14px 32px rgba(1, 8, 20, 0.28);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

.site-header .container.nav {
  width: calc(100% - 2.4rem) !important;
  max-width: 1720px !important;
  min-height: 76px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  color: #edf5ff !important;
  text-decoration: none;
}

.brand strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.06rem, 2.2vw, 1.28rem) !important;
  letter-spacing: 0.08em;
  font-weight: 700;
  line-height: 1.2;
}

.controls {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 0.38rem;
}

.switch-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.switch-label {
  min-width: 1.2rem;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  user-select: none;
}

.switch-btn {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: 0.22s ease;
}

.switch-btn::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(5, 15, 32, 0.34);
  transition: transform 0.22s ease, background 0.22s ease;
}

.switch-btn.is-on {
  border-color: rgba(151, 206, 255, 0.6);
  background: linear-gradient(135deg, rgba(49, 120, 255, 0.86), rgba(80, 185, 255, 0.86));
}

.switch-btn.is-on::after {
  transform: translateX(22px);
}

.switch-btn:focus-visible {
  outline: 2px solid rgba(151, 206, 255, 0.76);
  outline-offset: 2px;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .switch-btn {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }
}

.header-right {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-left: auto;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.menu a {
  position: relative;
  padding: 0.5rem 0.82rem;
  color: #d7e9ff !important;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: "Bricolage Grotesque", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: 0.22s ease;
}

.menu a:hover,
.menu a.active {
  border-color: var(--hm-line);
  background: rgba(80, 185, 255, 0.13);
}

.menu a:hover {
  transform: translateY(-1px);
}

.menu a.active::after {
  content: "";
  position: absolute;
  right: 0.72rem;
  bottom: -0.66rem;
  left: 0.72rem;
  height: 2px;
  background: currentColor;
  opacity: 0.85;
}

.navbar {
  background: linear-gradient(180deg, rgba(5, 15, 32, 0.94), rgba(5, 15, 32, 0.68)) !important;
  border-bottom: 1px solid rgba(196, 224, 255, 0.18);
  box-shadow: 0 14px 32px rgba(1, 8, 20, 0.28);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .navbar {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

.navbar .container-xl,
.container-xl {
  width: calc(100% - 2.4rem) !important;
  max-width: 1720px !important;
}

.navbar-brand a {
  color: #edf5ff !important;
  font-family: "Noto Serif SC", "Songti SC", serif;
  letter-spacing: 0.06em;
}

.navbar-brand.navbar-brand-autodark {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.12rem;
  margin: 0;
  line-height: 1.15;
}

.navbar-brand.navbar-brand-autodark > a {
  display: block;
}

.navbar-brand.navbar-brand-autodark > div {
  display: block;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.2;
}

.navbar-brand div {
  color: #9db4d9;
}

.navbar-nav {
  gap: 0.2rem;
  flex-wrap: wrap;
}

.navbar-nav .nav-item {
  width: auto !important;
}

@media (min-width: 768px) {
  .navbar-expand-md .navbar-collapse {
    justify-content: flex-end;
  }

  .navbar-expand-md .navbar-collapse > .d-flex {
    justify-content: flex-end;
  }

  .navbar-expand-md .navbar-nav {
    margin-left: auto;
    justify-content: flex-end;
  }
}

@media (min-width: 769px) and (max-width: 1500px) {
  .navbar-brand.navbar-brand-autodark > a {
    font-size: 18px !important;
    letter-spacing: 0.03em;
  }

  .navbar-brand.navbar-brand-autodark > div {
    font-size: 11px !important;
  }

  .navbar .nav-link {
    padding: 0.4rem 0.62rem !important;
    font-size: 0.82rem;
  }
}

.navbar .nav-link {
  color: #d6e8ff !important;
  border-radius: 999px;
  padding: 0.5rem 0.84rem !important;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.navbar .nav-link:hover {
  border-color: var(--hm-line);
  background: rgba(80, 185, 255, 0.12);
  transform: translateY(-1px);
}

.nav-item.active {
  border-radius: 999px;
  background: rgba(80, 185, 255, 0.16) !important;
}

@media (max-width: 700px) {
  .site-header .container.nav {
    width: calc(100% - 1rem) !important;
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.68rem 0;
  }

  .header-right {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-left: 0;
  }

  .menu {
    justify-content: flex-start;
  }

  .menu a {
    padding: 0.42rem 0.62rem;
    font-size: 0.81rem;
  }

  .menu a.active::after {
    bottom: -0.32rem;
  }

  .controls {
    width: auto;
    justify-content: flex-start;
    gap: 0.28rem;
  }

  .switch-group {
    gap: 0.18rem;
  }

  .switch-label {
    min-width: 1rem;
    font-size: 0.62rem;
  }

  .switch-btn {
    width: 40px;
    height: 22px;
  }

  .switch-btn::after {
    width: 14px;
    height: 14px;
  }

  .switch-btn.is-on::after {
    transform: translateX(20px);
  }
}

.carousel,
#carousel-default,
#carousel-indicators-thumb-vertical,
#carousel-indicators-thumb-vertical-v {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--hm-line);
  box-shadow: var(--hm-shadow);
}

.page-title,
.card-title,
.h1,
.h2,
.h3,
h1,
h2,
h3,
h4 {
  color: #f0f7ff !important;
  letter-spacing: 0.04em;
}

.page-title,
.card-title,
.h1,
.h2,
.h3 {
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.card {
  position: relative;
  border-radius: 20px !important;
  border: 1px solid var(--hm-line) !important;
  background: linear-gradient(145deg, rgba(11, 28, 56, 0.8), rgba(8, 18, 36, 0.76)) !important;
  box-shadow: var(--hm-shadow);
  color: var(--hm-text) !important;
  overflow: hidden;
  transition: transform 0.25s ease, background 0.25s ease;
}

.card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -40px;
  top: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80, 185, 255, 0.22), transparent 68%);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  background: linear-gradient(145deg, rgba(11, 30, 60, 0.92), rgba(9, 22, 44, 0.9)) !important;
}

.card-header {
  background: rgba(255, 255, 255, 0.01) !important;
  border-bottom: 1px solid rgba(196, 224, 255, 0.14) !important;
}

.markdown,
.text-muted,
.list-group-item .d-block.text-muted,
.list-group-item .text-secondary,
.list-group-item .text-muted,
.table .text-muted {
  color: var(--hm-muted) !important;
}

.list-group,
.list-group-flush,
.list-group-item {
  background: transparent !important;
  border-color: rgba(196, 224, 255, 0.18) !important;
}

.list-group-item {
  margin: 0.58rem 0.7rem;
  border-radius: 14px !important;
  border: 1px solid rgba(196, 224, 255, 0.2) !important;
  background: rgba(11, 30, 59, 0.52) !important;
  transition: 0.22s ease;
}

/* Theme-specific text contrast for list sections */
html[data-hmt03-theme="v1"] .list-group-item {
  color: #dbeaff !important;
}

html[data-hmt03-theme="v1"] .list-group-item .col > div:first-child {
  color: #eaf4ff !important;
  font-weight: 600;
}

html[data-hmt03-theme="v2"] .list-group-item {
  color: #2b486a !important;
}

html[data-hmt03-theme="v2"] .list-group-item .col > div:first-child {
  color: #1f3a58 !important;
  font-weight: 600;
}

.list-group-item:hover {
  background: rgba(80, 185, 255, 0.13) !important;
  transform: translateX(2px);
}

.table,
.table > :not(caption) > * > *,
.table.card-table {
  background: transparent !important;
  color: #dff0ff;
  border-color: rgba(196, 224, 255, 0.16) !important;
}

a,
a.text-reset,
a .text-reset,
.text-reset {
  color: #e1f1ff !important;
}

a:hover,
a.text-reset:hover {
  color: #8ad4ff !important;
}

.badge {
  border: 1px solid var(--hm-line);
  background: rgba(80, 185, 255, 0.14) !important;
  color: #dff0ff !important;
}

.avatar {
  border: 1px solid rgba(209, 228, 255, 0.42);
  box-shadow: 0 10px 22px rgba(4, 11, 24, 0.35);
}

.btn,
.btn-primary,
button,
input[type="button"],
input[type="submit"] {
  border-radius: 999px !important;
}

.footer,
.footer-transparent {
  margin-top: 1.2rem;
  color: #a8bfdc !important;
  border-top: 1px solid rgba(196, 224, 255, 0.14);
  background: rgba(7, 18, 36, 0.7) !important;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .footer,
  .footer-transparent {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}

.footer a,
.footer-transparent a {
  color: #d7e9ff !important;
}

.row-cards {
  row-gap: 0.95rem;
}

@media (max-width: 1024px) {
  .page-wrapper {
    margin-top: 82px !important;
  }

  .navbar .nav-link {
    padding: 0.44rem 0.72rem !important;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .page-wrapper {
    margin-top: 74px !important;
  }

  .navbar .container-xl,
  .container-xl {
    width: calc(100% - 1rem) !important;
  }

  .navbar-brand a {
    font-size: 18px !important;
  }

  .navbar-brand div {
    display: none;
  }

  .list-group-item {
    margin: 0.5rem 0.5rem;
    padding: 0.72rem !important;
  }
}
