/* 统一导航独立样式：供未加载 style.css 的独立主题页（debate_dashboard / journal /
   strategy-editor / trader-test 等）使用。
   与 style.css 中「统一导航」段保持同步；颜色在 .site-nav 作用域内定义，不依赖页面 :root 变量。 */

.site-nav {
  --nav-ink: #152d35;
  --nav-muted: #65737a;
  --nav-line: #dce2df;
  --nav-good: #0e7c66;
  font-family: Avenir Next, Helvetica Neue, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 独立页面顶栏容器：白色横条，右对齐导航 */
.nav-standalone-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 24px;
  background: #ffffff;
  border-bottom: 1px solid #dce2df;
  position: relative;
  z-index: 40;
}

.site-nav .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav,
.site-nav-panel,
.site-nav-primary,
.site-nav-actions {
  display: flex;
  align-items: center;
}

.site-nav *,
.site-nav *::before,
.site-nav *::after {
  box-sizing: border-box;
}

.site-nav-panel { gap: 8px; }
.site-nav-primary { gap: 2px; }
.site-nav-actions { gap: 6px; }

.site-nav a,
.site-nav button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--nav-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav button:hover {
  background: #f1f5f3;
  color: var(--nav-ink);
}

.site-nav a:focus-visible,
.site-nav button:focus-visible {
  outline: 2px solid var(--nav-good);
  outline-offset: 2px;
}

.site-nav a.active,
.site-nav button.active {
  background: rgba(14, 124, 102, 0.09);
  color: var(--nav-good);
  font-weight: 700;
}

.site-nav button.nav-ai {
  border: 1px solid rgba(14, 124, 102, 0.24);
  color: var(--nav-good);
  font-weight: 700;
}

.site-nav .nav-menu-toggle { display: none !important; }
.site-nav .nav-menu-icon { display: grid; gap: 3px; width: 17px; }
.site-nav .nav-menu-icon i { display: block; width: 100%; height: 2px; border-radius: 2px; background: currentColor; }

.site-nav .toolbox-wrap { position: relative; }
.site-nav button.nav-toolbox { font-size: 13px; }
.site-nav .toolbox-menu {
  position: absolute;
  right: 0;
  top: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(176px, 1fr));
  gap: 6px 10px;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--nav-line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(21, 45, 53, .14);
  width: 400px;
  max-height: min(72vh, 620px);
  overflow-y: auto;
  padding: 10px;
  z-index: 200;
}
.site-nav .toolbox-menu[hidden] { display: none; }
.site-nav .toolbox-section { min-width: 0; }
.site-nav .toolbox-menu a {
  display: flex;
  justify-content: flex-start;
  min-height: 32px;
  padding: 7px 10px;
  text-decoration: none;
  color: var(--nav-ink);
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
}
.site-nav .toolbox-menu a:hover {
  background: #f1f5f9;
  color: var(--nav-good);
}
.site-nav .toolbox-group {
  padding: 8px 10px 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--nav-muted);
  letter-spacing: 0;
}

@media (max-width: 860px) {
  .site-nav {
    position: relative;
    order: 2;
    margin-left: auto;
  }

  .site-nav .nav-menu-toggle {
    display: inline-flex !important;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid var(--nav-line);
    background: #fff;
  }

  .site-nav .site-nav-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 250;
    display: none;
    width: min(344px, calc(100vw - 32px));
    max-height: min(72vh, 620px);
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--nav-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(21, 45, 53, .16);
  }

  .site-nav .site-nav-panel.open,
  .site-nav .site-nav-primary,
  .site-nav .site-nav-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav .site-nav-primary,
  .site-nav .site-nav-actions {
    width: 100%;
    gap: 2px;
  }

  .site-nav .site-nav-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--nav-line);
  }

  .site-nav a,
  .site-nav button {
    width: 100%;
    justify-content: flex-start;
    min-height: 40px;
    padding: 10px 12px;
  }

  .site-nav .toolbox-wrap { width: 100%; }

  .site-nav .toolbox-menu {
    position: static;
    grid-template-columns: 1fr;
    width: 100%;
    max-height: none;
    margin-top: 6px;
    padding: 6px;
    border-color: #e7ece9;
    box-shadow: none;
  }
}
