/**
 * ops-nav.css · 运营平台左侧分组导航（全站共享）
 * Token 来源：/theme/ops-theme-dual.css
 */

:root {
  --side: var(--card);
  --badge: var(--accent);
}

html[data-ops-nav="1"] {
  --ops-nav-w: var(--sidebar-w, 220px);
}

html[data-ops-nav="1"] body {
  padding-left: var(--ops-nav-w);
  min-height: 100vh;
}

html[data-ops-nav="1"][data-ops-dev="1"] body {
  padding-top: 32px;
}

/* ===== 工程台顶栏（仅 /dev/ 页） ===== */
.ops-dev-banner {
  position: fixed;
  top: 0;
  left: var(--ops-nav-w, 220px);
  right: 0;
  height: 32px;
  z-index: 99;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--warn);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  box-sizing: border-box;
}

.ops-dev-banner a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  margin-left: 4px;
}

.ops-nav-group-label.is-warn {
  color: var(--warn);
}

/* ===== 侧栏容器 ===== */
.ops-side {
  width: var(--ops-nav-w, 220px);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background: var(--side);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ===== 品牌 ===== */
.ops-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 12px;
  margin-bottom: 2px;
}

.ops-brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}

.ops-brand-mark svg {
  display: block;
}

.ops-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
}

/* ===== 分组导航 ===== */
/* 17 项 + 5 组名 + 底部主题键必须在 900px 高内一屏放下（1440×900 定稿视口） */
.ops-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ops-nav-group-label {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
  padding: 0 10px 3px;
  user-select: none;
}

.ops-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 31px;
  padding: 0 10px;
  margin-bottom: 1px;
  border-radius: var(--radius-ctl);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.ops-nav-item:hover {
  background: var(--soft);
  color: var(--accent);
}

.ops-nav-item.is-active {
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
}

.ops-nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-nav-badge {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--badge);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-family: var(--font-mono);
}

.ops-nav-badge[hidden] {
  display: none;
}

/* ===== 底部主题切换 ===== */
.ops-side-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ops-theme-btn {
  width: 100%;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ops-theme-btn:hover {
  background: var(--soft);
  color: var(--accent);
  border-color: var(--accent);
}

.ops-theme-icon {
  display: block;
}

.ops-theme-sun {
  display: none;
}

html[data-ops-nav="1"] .wrap,
html[data-ops-nav="1"] main.wrap {
  box-sizing: border-box;
}

/* ===== 窄屏：收成图标轨 ===== */
@media (max-width: 900px) {
  html[data-ops-nav="1"] {
    --ops-nav-w: 56px;
  }

  html[data-ops-nav="1"] body {
    padding-left: 56px;
  }

  .ops-brand-name,
  .ops-nav-group-label,
  .ops-nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .ops-brand {
    justify-content: center;
    padding: 4px 0 12px;
  }

  .ops-nav-item {
    justify-content: center;
    padding: 0;
  }

  .ops-nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 9px;
    padding: 0 3px;
  }

  .ops-nav-item {
    position: relative;
  }

}
