:root {
  --quant-sidebar-width: 236px;
  --quant-nav-border: #d9dee7;
  --quant-nav-text: #344054;
  --quant-nav-muted: #667085;
  --quant-nav-accent: #c5221f;
  --quant-nav-bg: #f8fafc;
}

body {
  padding-left: var(--quant-sidebar-width);
}

.site-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20020;
  width: var(--quant-sidebar-width);
  padding: 0 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--quant-nav-bg);
  border-right: 1px solid var(--quant-nav-border);
  box-shadow: 3px 0 14px rgba(15, 23, 42, .07);
  color: var(--quant-nav-text);
  font-family: Roboto, system-ui, -apple-system, sans-serif;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}

.site-nav-top {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 68px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--quant-nav-bg);
  border-bottom: 1px solid #e5e9f0;
}

.site-header .brand {
  color: #111827;
  font-family: Newsreader, Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
}

.site-header .brand:hover {
  color: #991b1b;
  text-decoration: none;
}

.site-header .group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 10px;
}

.site-header .group-toggle {
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: #475467;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
}

.site-header .group-toggle:hover {
  color: #1f2937;
  background: #eef1f5;
}

.site-header .group-toggle:focus-visible {
  outline: 3px solid rgba(197, 34, 31, .2);
  outline-offset: 1px;
}

.site-header .group-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .16s ease;
}

.site-header .group-toggle.open .group-chevron {
  transform: rotate(45deg);
}

.site-header .group-panel {
  display: grid;
  gap: 3px;
  padding-top: 2px;
}

.site-header .group-panel[hidden] {
  display: none;
}

.site-header .tab {
  min-height: 39px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  color: var(--quant-nav-text);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.site-header .tab-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.site-header .tab-badge {
  margin-left: auto;
  padding: 2px 5px;
  flex: 0 0 auto;
  color: #667085;
  background: #e9edf3;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.site-header .tab.paused {
  color: #667085;
}

.site-header .tab:hover {
  color: #111827;
  background: #e9edf3;
  text-decoration: none;
}

.site-header .tab:focus-visible,
.site-header .brand:focus-visible,
.site-nav-toggle:focus-visible,
.site-nav-close:focus-visible {
  outline: 3px solid rgba(197, 34, 31, .26);
  outline-offset: 2px;
}

.site-header .tab.active {
  color: #991b1b;
  background: #feecec;
  box-shadow: inset 3px 0 0 var(--quant-nav-accent);
}

.site-header .tab.active:hover {
  background: #fde2e2;
}

.site-header .sep {
  display: none;
}

.site-nav-toggle,
.site-nav-close,
.site-nav-backdrop {
  border: 0;
  padding: 0;
  font: inherit;
}

.site-nav-toggle {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20000;
  width: 44px;
  height: 44px;
  place-items: center;
  cursor: pointer;
  color: #1f2937;
  background: #fff;
  border: 1px solid #d6dbe3;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .14);
}

.site-nav-close {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  cursor: pointer;
  color: #475467;
  background: transparent;
  border-radius: 4px;
}

.site-nav-close:hover {
  background: #e9edf3;
}

.site-nav-icon,
.site-nav-icon::before,
.site-nav-icon::after {
  width: 19px;
  height: 2px;
  display: block;
  background: currentColor;
  border-radius: 2px;
}

.site-nav-icon {
  position: relative;
}

.site-nav-icon::before,
.site-nav-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.site-nav-icon::before { top: -6px; }
.site-nav-icon::after { top: 6px; }

.site-nav-close-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.site-nav-close-icon::before,
.site-nav-close-icon::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.site-nav-close-icon::before { transform: rotate(45deg); }
.site-nav-close-icon::after { transform: rotate(-45deg); }

.site-nav-backdrop {
  display: none;
}

.site-nav-skip {
  position: fixed;
  top: 10px;
  left: calc(var(--quant-sidebar-width) + 12px);
  z-index: 20030;
  padding: 9px 12px;
  color: #fff;
  background: #991b1b;
  border-radius: 4px;
  font: 600 13px/1.2 Roboto, system-ui, sans-serif;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .15s ease;
}

.site-nav-skip:focus {
  transform: translateY(0);
}

.strategy-change-log {
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 0 20px;
  color: #1f2937;
  font-family: Roboto, system-ui, -apple-system, sans-serif;
}

.strategy-change-log details {
  background: #fff;
  border: 1px solid #d1d5db;
  border-left: 3px solid var(--quant-nav-accent);
}

.strategy-change-log summary {
  min-height: 44px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}

.strategy-change-log summary::-webkit-details-marker { display: none; }
.strategy-change-log summary::after {
  content: "展开";
  margin-left: 2px;
  color: #6b7280;
  font-size: 12px;
}
.strategy-change-log details[open] summary::after { content: "收起"; }
.strategy-change-label { color: #991b1b; font-weight: 700; white-space: nowrap; }
.strategy-change-latest { overflow: hidden; color: #374151; text-overflow: ellipsis; white-space: nowrap; }
.strategy-change-count { margin-left: auto; color: #6b7280; white-space: nowrap; }
.strategy-change-list { padding: 4px 16px 14px; border-top: 1px solid #e5e7eb; }
.strategy-change-item { padding: 14px 0; border-bottom: 1px solid #eef0f2; }
.strategy-change-item:last-child { border-bottom: 0; }
.strategy-change-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.strategy-change-meta time { color: #6b7280; font-size: 12px; font-variant-numeric: tabular-nums; }
.strategy-change-meta span {
  padding: 1px 5px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 11px;
}
.strategy-change-item h3 { margin: 0 0 6px; font: 700 14px/1.45 Roboto, system-ui, sans-serif; }
.strategy-change-item ul { margin: 0; padding-left: 18px; color: #4b5563; font-size: 13px; line-height: 1.65; }
.strategy-change-note,
.strategy-change-effective { margin: 6px 0 0; color: #6b7280; font-size: 12px; line-height: 1.55; }
.strategy-change-effective { color: #166534; font-weight: 600; }

@media (max-width: 899px) {
  body {
    padding-top: 60px;
    padding-left: 0;
  }

  body.quant-nav-open {
    overflow: hidden;
  }

  .site-header {
    width: min(82vw, 292px);
    padding: 0 12px 18px;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }

  body.quant-nav-open .site-header {
    transform: translateX(0);
  }

  .site-nav-toggle,
  .site-nav-close {
    display: grid;
  }

  body.quant-nav-open .site-nav-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .site-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20010;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: rgba(15, 23, 42, .38);
  }

  body.quant-nav-open .site-nav-backdrop {
    display: block;
  }

  .site-nav-skip {
    left: 64px;
  }

  .strategy-change-log {
    margin-top: 0;
    padding: 0 10px;
  }

  .strategy-change-log summary { gap: 8px; padding: 9px 10px; }
  .strategy-change-label,
  .strategy-change-latest { font-size: 12px; }
  .strategy-change-count,
  .strategy-change-log summary::after { display: none; }
  .strategy-change-list { padding: 2px 12px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-nav-skip,
  .site-header .tab {
    transition: none;
  }

  .site-header .group-chevron {
    transition: none;
  }
}
