body.front {
  --cms-nav-ink: #182330;
  --cms-nav-muted: #526174;
  --cms-nav-panel: #fff;
  --cms-nav-soft: #eef2f6;
  --cms-nav-border: #dbe2eb;
  --cms-nav-active: #134e73;
  --cms-nav-active-bg: #e4f1fa;
  --cms-nav-shadow: 0 14px 34px #192b4025;
}

html:is([data-portal-theme="dark"], [data-db-theme="dark"]) body.front {
  --cms-nav-ink: #f2f5fa;
  --cms-nav-muted: #b8c4d5;
  --cms-nav-panel: #1c212a;
  --cms-nav-soft: #262e3a;
  --cms-nav-border: #3c4858;
  --cms-nav-active: #91d9f9;
  --cms-nav-active-bg: #243e50;
  --cms-nav-shadow: 0 14px 34px #0006;
}

body.front :is(.cms-nav-desktop,.cms-nav-mobile,.cms-category-panel,.cms-mobile-footer)
  :is(a,button,summary):focus-visible {
  outline: 2px solid var(--cms-nav-active);
  outline-offset: 2px;
}

body.front .cms-nav-desktop {
  display: flex;
  align-items: center;
  gap: clamp(5px,1.15vw,19px);
  flex: 0 0 auto;
  margin-inline-end: auto;
  white-space: nowrap;
  font-size: 15px;
}

body.front .cms-nav-desktop :is(a,summary) {
  text-decoration: none;
  color: var(--cms-nav-ink);
}

body.front .cms-nav-desktop > a,
body.front .cms-nav-channel > a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 4px;
  font-weight: 560;
}

body.front .cms-nav-desktop :is(a:hover,a[aria-current]) {
  color: var(--cms-nav-active) !important;
}

body.front .cms-nav-channel {
  display: flex;
  align-items: center;
  position: relative;
}

body.front .cms-nav-submenu {
  position: static;
}

body.front .cms-nav-submenu > summary,
body.front .cms-nav-mobile > summary,
body.front .cms-nav-mobile-channel > summary,
body.front .cms-category-more > summary {
  list-style: none;
  cursor: pointer;
}
body.front :is(.cms-nav-submenu,.cms-nav-mobile,.cms-nav-mobile-channel,.cms-category-more)
  > summary::-webkit-details-marker { display: none; }

body.front .cms-nav-submenu > summary {
  display: grid;
  place-items: center;
  width: 27px;
  height: 42px;
  border-radius: 5px;
}

body.front .cms-nav-submenu > summary > span,
.cms-nav-arrow {
  display: inline-block;
  width: 9px;
  height: 5px;
  background-color: currentColor;
  clip-path: polygon(0 0,100% 0,50% 100%);
}
body.front :is(.cms-nav-submenu,.cms-nav-mobile-channel,.cms-category-more)[open] > summary > span {
  transform: rotate(180deg);
}

body.front .cms-nav-submenu[open] > summary,
body.front .cms-nav-submenu > summary:hover {
  color: var(--cms-nav-active) !important;
  background: var(--cms-nav-active-bg) !important;
}

body.front .cms-nav-flyout {
  position: absolute;
  inset: calc(100% + 5px) auto auto 0;
  z-index: 55;
  width: min(390px,32vw);
  box-sizing: border-box;
  padding: 12px;
  background: var(--cms-nav-panel) !important;
  border: 1px solid var(--cms-nav-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--cms-nav-shadow) !important;
}

body.front .cms-nav-flyout ul,
body.front .cms-nav-mobile-channel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

body.front .cms-nav-flyout a,
body.front .cms-nav-mobile-panel a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 9px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--cms-nav-ink);
}

body.front .cms-nav-flyout a:hover,
body.front .cms-nav-mobile-panel a:is(:hover,[aria-current]) {
  background: var(--cms-nav-active-bg) !important;
  color: var(--cms-nav-active) !important;
}

html body.front .cms-nav-desktop > .ref-app-entry {
  display: inline-flex !important;
  min-width: 0 !important;
  min-height: 34px !important;
  padding: 0 11px !important;
  margin: 0 !important;
  color: var(--cms-nav-active) !important;
  background: var(--cms-nav-active-bg) !important;
  border-radius: 7px !important;
  font-weight: 650;
  font-size: 13px !important;
}

html body.front[class] header[class] details.cms-nav-mobile,
.cms-mobile-footer { display: none !important; }

html body.front[class] section.cms-category-panel {
  display: grid !important;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  margin: 12px 0 16px;
  padding: 10px 17px;
  border: 1px solid var(--cms-nav-border) !important;
  border-radius: 14px !important;
  background: var(--cms-nav-panel) !important;
  color: var(--cms-nav-ink);
}

body.front .cms-category-row {
  display: grid;
  grid-template-columns: 64px minmax(0,1fr);
  align-items: start;
  gap: 11px;
  padding: 8px 0;
  border-bottom: 1px solid var(--cms-nav-border);
}

body.front .cms-category-row > span {
  padding-top: 7px;
  color: var(--cms-nav-muted);
  font-size: 13px;
  font-weight: 650;
}

body.front .cms-category-row nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 3px 6px;
  min-width: 0;
  margin: 0;
}

body.front .cms-category-row nav a {
  min-height: 31px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px !important;
  color: var(--cms-nav-ink);
  font-size: 14px;
  line-height: 1.25;
  text-decoration: none;
}

body.front .cms-category-row nav a:hover { background: var(--cms-nav-soft) !important; }
body.front .cms-category-row nav a[aria-current] {
  background: var(--cms-nav-active-bg) !important;
  color: var(--cms-nav-active) !important;
  font-weight: 700;
}

body.front .cms-category-more > summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-inline: 3px;
  font-size: 13px;
  color: var(--cms-nav-muted);
}

body.front .cms-category-heading { margin-block: 18px 8px; }

@media (max-width: 960px) {
  html body.front .cms-nav-desktop { display: none !important; }
  html body.front[class] header[class] details.cms-nav-mobile {
    display: block !important;
    position: relative;
    flex: none;
    order: 3;
  }
  html body.front .cms-nav-mobile > summary {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: var(--cms-nav-ink);
  }
  body.front .cms-nav-mobile > summary > svg {
    display: block;
    width: 21px;
    height: 21px;
  }
  body.front .cms-nav-mobile[open] > summary { background: var(--cms-nav-soft); }
  html body.front[class] header[class] .cms-nav-mobile-panel {
    position: fixed;
    inset: auto 12px auto auto;
    z-index: 65;
    box-sizing: border-box;
    width: min(440px,calc(100vw - 24px));
    max-height: calc(100dvh - 150px);
    padding: 7px 14px 12px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--cms-nav-border) !important;
    border-radius: 14px !important;
    background: var(--cms-nav-panel) !important;
    color: var(--cms-nav-ink);
    box-shadow: var(--cms-nav-shadow) !important;
  }
  body.front .cms-nav-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-block: 4px;
  }
  body.front .cms-nav-quick a { min-height: 40px; }
  body.front .cms-nav-mobile-channel {
    border-top: 1px solid var(--cms-nav-border);
  }
  body.front .cms-nav-mobile-channel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 43px;
    padding: 0 9px;
    font-weight: 650;
  }
  body.front .cms-nav-mobile-channel ul { margin-bottom: 8px; }
  body.front .cms-nav-secondary {
    border-top: 1px solid var(--cms-nav-border);
    font-size: 13px;
  }
}

@media (max-width: 700px) {
  html body.front[class] section.cms-category-panel { display: none !important; }

  html body.front .cms-mobile-footer {
    display: block !important;
    --cms-dock-size: 54px;
    --cms-app-size: 50px;
  }

  html body.front[class]:has(.cms-mobile-footer) {
    padding-bottom: calc(60px + env(safe-area-inset-bottom,0px)) !important;
  }

  html body.front:has(.cms-app-prompt:not([hidden])):not(:has([data-player-frame])) {
    padding-bottom: calc(110px + env(safe-area-inset-bottom,0px)) !important;
  }

  html body.front[class] .cms-mobile-footer > .ref-mobile-dock {
    display: flex !important;
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    min-height: var(--cms-dock-size);
    box-sizing: border-box;
    padding: 0 8px env(safe-area-inset-bottom,0px);
    background: var(--cms-nav-panel) !important;
    color: var(--cms-nav-ink);
    border-top: 1px solid var(--cms-nav-border) !important;
  }

  html body.front[class] .cms-mobile-footer > .ref-mobile-dock > a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 53px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 0;
    font-size: 11px !important;
    line-height: 1.15;
    color: var(--cms-nav-muted) !important;
    text-decoration: none;
  }
  body.front .cms-mobile-footer > .ref-mobile-dock > a > svg {
    width: 20px;
    height: 20px;
  }
  html body.front[class] .cms-mobile-footer > .ref-mobile-dock > a[aria-current] {
    color: var(--cms-nav-active) !important;
    font-weight: 700 !important;
  }

  html body.front[class] .cms-mobile-footer > .cms-app-prompt {
    position: fixed;
    inset: auto 10px calc(var(--cms-dock-size) + 5px + env(safe-area-inset-bottom,0px));
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 9px;
    box-sizing: border-box;
    min-height: 44px;
    padding: 4px 7px 4px 11px;
    border: 1px solid var(--cms-nav-border) !important;
    border-radius: 11px !important;
    background: var(--cms-nav-panel) !important;
    color: var(--cms-nav-ink);
    box-shadow: 0 3px 11px #0002;
    font-size: 13px;
  }

  html body.front[class] .cms-mobile-footer > .cms-app-prompt[hidden],
  body.front .cms-app-prompt button[hidden] { display: none; }

  body.front .cms-app-prompt > svg { width: 19px; height: 19px; flex: none; color: var(--cms-nav-active); }
  body.front .cms-app-prompt > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.front .cms-app-prompt > :is(a,button) {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border: 0;
    border-radius: 6px;
    text-decoration: none;
  }
  html body.front[class] .cms-app-prompt > a {
    padding-inline: 10px;
    color: var(--cms-nav-active) !important;
    background: var(--cms-nav-active-bg) !important;
    border-radius: 6px !important;
    font-weight: 650;
  }
  body.front .cms-app-prompt > button {
    min-width: 34px;
    font: inherit;
    font-size: 20px;
    color: var(--cms-nav-muted);
    cursor: pointer;
    background: transparent;
  }

  html body.front[class]:has([data-player-frame]) .cms-mobile-footer > .cms-app-prompt {
    position: static;
    margin: 8px 12px;
  }
  html body.front:is(.projection-mode,:has(:fullscreen)) .cms-mobile-footer {
    display: none !important;
  }
}

.ref-home-cover {
  min-width: 0;
  margin: 14px 0 24px;
}

.ref-home-cover-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}

body.front .ref-home-cover-head h2 {
  margin: 0;
  color: var(--ui-ink, var(--cms-nav-ink));
  font: 700 clamp(24px, 2.6vw, 38px)/1.2 "Songti SC", "Noto Serif CJK SC", Georgia, serif;
}

.ref-home-cover-head a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 7px;
  color: var(--ui-accent, var(--cms-nav-active));
  font-size: 14px;
  font-weight: 600;
}

.ref-home-cover-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: clamp(16px, 2.7vw, 40px);
  padding: 19px clamp(10px, 1.5vw, 22px) 30px;
}

.ref-home-cover-card {
  --cover-angle: 3deg;
  --cover-offset: 0px;
  min-width: 0;
  transform: translateY(var(--cover-offset)) rotate(var(--cover-angle));
}

.ref-home-cover-card:nth-child(even) {
  --cover-angle: 4deg;
  --cover-offset: 12px;
}

.ref-home-cover-card:nth-child(3) {
  --cover-angle: 1.5deg;
  --cover-offset: -4px;
}

body.front .ref-home-cover-card > a {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  isolation: isolate;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
  background: #192a35;
  box-shadow: 0 10px 20px -9px #061522a6, inset 0 0 0 1px #fff3;
}

.ref-home-cover-card > a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #07141bdc, transparent 33%, #07141b0d 43%, #07141bc9 77%, #07141bf5);
  box-shadow: inset 0 0 0 1px #ffffff30;
}

body.front .ref-home-cover-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  object-fit: cover;
}

html body.front[class] .ref-home-cover-card .ref-home-cover-brand {
  position: absolute;
  top: 7%;
  inset-inline: 8%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff !important;
  font: 700 clamp(16px, 2vw, 30px)/1.2 "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  text-shadow: 0 1px 8px #000b;
}

.ref-home-cover-story {
  position: absolute;
  bottom: 7%;
  inset-inline: 8%;
  color: #fff;
}

html body.front[class] .ref-home-cover-card .ref-home-cover-category {
  display: block;
  margin-bottom: 5px;
  color: #eef4f6 !important;
  font-size: 12px;
}

body.front .ref-home-cover-story h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  color: #fff;
  font: 700 clamp(17px, 1.8vw, 28px)/1.25 "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  text-shadow: 0 1px 8px #000a;
}

html body.front[class] .ref-home-cover-card .ref-home-cover-arrow {
  display: block;
  margin-top: 7px;
  color: #fff !important;
  font-size: 20px;
  line-height: 1;
  text-align: end;
}

.ref-home-cover :is(a:focus-visible) {
  outline: 2px solid var(--cms-nav-active);
  outline-offset: 3px;
}

.ref-home-cover-hint {
  display: none;
}

@media (max-width: 720px) {
  .ref-home-cover {
    margin: 8px 0 18px;
  }

  .ref-home-cover-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(128px, 44%);
    gap: 16px;
    padding: 15px 10px 25px;
    overflow-x: auto;
    scroll-padding-inline: 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .ref-home-cover-card {
    scroll-snap-align: start;
  }

  .ref-home-cover-card:nth-child(even) {
    --cover-offset: 7px;
  }

  .ref-home-cover-brand {
    font-size: clamp(18px, 4vw, 26px);
  }

  .ref-home-cover-hint {
    display: block;
    margin: 3px 0 0;
    color: var(--ui-muted, var(--cms-nav-muted));
    font-size: 12px;
  }
}
