/* ==========================================================================
   共享组件层
   与 base.css 的分工：base 管地基（颜色、字体、按钮、输入、卡片、弹层），
   这里管业务组件（统计卡、分段控件、时间线、环形进度、命令面板等）。
   命名前缀保持业务语义，避免和 base 冲突。
   ========================================================================== */

:root {
  --top-h: 56px;
  --nav-w: 216px;
  --nav-w-min: 64px;

  --r-xs: 3px;
  --r-pill: 999px;
}

/* ==========================================================================
   1. 应用外壳
   ========================================================================== */

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---- 侧边导航 ---- */
.nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--nav-w);
  background: linear-gradient(180deg, var(--nav-grad-a), var(--nav-grad-b));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width 240ms var(--ease-glide);
}

.nav-brand {
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 16px;
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line-faint);
}

/* 品牌标记：星核 SVG，自带呼吸律动，这里只负责尺寸与定位 */
.nav-brand .mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: transparent;
  border-radius: 0;
}
.nav-brand .mark svg { width: 32px; height: 32px; overflow: visible; }
.nav-brand .mark::before { content: none; }

.nav-brand .name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--text-1);
}

.nav-brand .name em {
  display: block;
  font-style: normal;
  color: var(--text-3);
  font-weight: 400;
  font-size: 9px;
  margin: 1px 0 0;
  letter-spacing: 0.02em;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px 8px;
  scrollbar-width: thin;
}

.nav-group-label {
  font-size: 10.5px;
  color: var(--text-4);
  letter-spacing: 0.1em;
  padding: 14px 10px 7px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 200ms var(--ease-swift);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 13px;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
  transition: background 150ms var(--ease-swift), color 150ms var(--ease-swift),
    transform 150ms var(--ease-glide);
}

.nav-item:hover {
  background: var(--bg-panel-2);
  color: var(--text-1);
}

.nav-item:active { transform: scale(0.985); }

.nav-item.active {
  background: linear-gradient(90deg, var(--brand-soft), transparent);
  color: var(--active-text);
  font-weight: 500;
}

/* 激活态左侧竖条：从中间长出 */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2.5px;
  height: 18px;
  margin-top: -9px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
  box-shadow: 0 0 12px var(--brand);
  animation: navBarIn 300ms var(--ease-spring) both;
}

@keyframes navBarIn {
  from { height: 0; margin-top: 0; opacity: 0; }
  to   { height: 18px; margin-top: -9px; opacity: 1; }
}

.nav-item .ico {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.9;
  transition: transform 200ms var(--ease-spring);
}

.nav-item:hover .ico { transform: scale(1.06); }
.nav-item.active .ico { opacity: 1; }

.nav-item .label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 180ms var(--ease-swift);
}

.nav-item .count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--brand-glow);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(73, 164, 255, .24), rgba(123, 108, 255, .16)),
    var(--bg-raised);
  box-shadow: inset 0 1px 0 var(--surface-edge), 0 0 14px var(--brand-soft);
  color: var(--brand-text);
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
  transform: translateY(-1px);
}

.nav-item.active .count,
.nav-item .count:not(.soft) {
  border-color: color-mix(in srgb, var(--brand) 42%, transparent);
  background:
    linear-gradient(135deg, rgba(48, 145, 255, .38), rgba(112, 100, 255, .26)),
    var(--brand-soft);
  color: var(--brand-text);
}

[data-theme="dark"] .nav-item .count {
  border-color: rgba(104, 170, 255, .35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 16px rgba(68, 132, 255, .20);
}

.nav-item .count.soft {
  background: var(--bg-raised);
  color: var(--text-2);
}

.nav-foot {
  border-top: 1px solid var(--line-faint);
  padding: 9px;
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 150ms var(--ease-swift);
  overflow: hidden;
  outline: none;
}

.user-chip:hover,
.user-chip:focus-visible { background: var(--bg-panel-2); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--avatar-grad-a), var(--avatar-grad-b));
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-brand-text);
  flex-shrink: 0;
  letter-spacing: 0;
  position: relative;
}

.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.xl { width: 54px; height: 54px; font-size: 18px; }

/* 在线小绿点 */
.avatar .on {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid var(--dot-ring);
}

.user-chip .meta { min-width: 0; overflow: hidden; }
.user-chip .n {
  font-size: 12.5px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.user-chip .r {
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ---- 主区 ---- */
.main {
  flex: 1;
  margin-left: var(--nav-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 240ms var(--ease-glide);
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--top-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  z-index: 30;
}

.topbar .crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-4);
  min-width: 0;
}

.topbar .crumb b {
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar h1 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .spacer { flex: 1; }

/* 全局搜索按钮 */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-panel);
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 150ms var(--ease-swift), background 150ms var(--ease-swift),
    color 150ms var(--ease-swift);
}

.search-trigger:hover {
  border-color: var(--line-hover);
  background: var(--bg-panel-2);
  color: var(--text-2);
}

.search-trigger .ico { width: 14px; height: 14px; }

kbd,
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0;
}

/* 顶栏圆形图标按钮 */
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 150ms var(--ease-swift), color 150ms var(--ease-swift),
    border-color 150ms var(--ease-swift), transform 90ms var(--ease-swift);
}

.icon-btn:hover {
  background: var(--bg-panel-2);
  color: var(--text-1);
  border-color: var(--line-strong);
}

.icon-btn:active { transform: scale(0.94); }
.icon-btn .ico { width: 16px; height: 16px; }

.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--dot-ring);
}

.page {
  /* 大屏铺满：不设 max-width 硬上限，用随视口增长的内边距控制可读性 */
  padding: clamp(20px, 1.4vw, 28px) clamp(20px, 1.6vw, 32px);
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* 窄屏导航收起 */
.nav.collapsed { width: var(--nav-w-min); }
.nav.collapsed .nav-brand .name,
.nav.collapsed .nav-item .label,
.nav.collapsed .nav-item .count,
.nav.collapsed .nav-group-label,
.nav.collapsed .user-chip .meta { opacity: 0; pointer-events: none; }
.nav.collapsed .nav-item { justify-content: center; padding: 0; }
.nav.collapsed .nav-brand { padding: 0; justify-content: center; }
.nav.collapsed .user-chip { justify-content: center; }
.main.wide { margin-left: var(--nav-w-min); }

/* ==========================================================================
   2. 区块标题
   ========================================================================== */

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-head .sub {
  font-size: 11.5px;
  color: var(--text-4);
}

.section-head .spacer { flex: 1; }

/* 小节左侧竖线 */
.section-head.ticked h2::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand-glow);
}

/* ==========================================================================
   3. 统计卡
   ========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
}

.stat {
  background: linear-gradient(160deg, var(--stat-grad-a), var(--stat-grad-b) 78%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 15px 13px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: border-color 180ms var(--ease-swift), transform 180ms var(--ease-glide),
    box-shadow 180ms var(--ease-swift);
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sheen-1), transparent);
}

.stat:hover {
  border-color: var(--line-strong);
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--shadow-2);
}

.stat .k {
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.stat .v {
  font-size: 27px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat .u {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 4px;
  letter-spacing: 0;
}

.stat .d {
  font-size: 11px;
  margin-top: 6px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 左侧色条：用绝对定位，不占布局 */
.stat .accent {
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2.5px;
  border-radius: 0 2px 2px 0;
}

.stat.tone-brand .v { color: var(--brand-text); }
.stat.tone-brand .accent { background: var(--brand); box-shadow: 0 0 10px var(--brand-glow); }
.stat.tone-ok .v { color: var(--ok-text); }
.stat.tone-ok .accent { background: var(--ok); }
.stat.tone-warn .v { color: var(--warn-text); }
.stat.tone-warn .accent { background: var(--warn); }
.stat.tone-danger .v { color: var(--danger-text); }
.stat.tone-danger .accent { background: var(--danger); }
.stat.tone-info .v { color: var(--info-text); }
.stat.tone-info .accent { background: var(--info); }
.stat.tone-muted .v { color: var(--text-1); }
.stat.tone-muted .accent { background: var(--text-4); }

/* 统计卡背后的柔光 */
.stat .halo {
  position: absolute;
  right: -30px;
  bottom: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  opacity: 0.5;
  pointer-events: none;
}
.stat.tone-brand .halo { background: radial-gradient(circle, var(--aurora-1), transparent 70%); }
.stat.tone-danger .halo { background: radial-gradient(circle, var(--danger-soft), transparent 70%); }
.stat.tone-warn .halo { background: radial-gradient(circle, var(--warn-soft), transparent 70%); }
.stat.tone-ok .halo { background: radial-gradient(circle, var(--ok-soft), transparent 70%); }

/* ==========================================================================
   4. 分段控件 / 筛选条
   ========================================================================== */

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  position: relative;
}

.segmented button {
  height: 26px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  transition: color 160ms var(--ease-swift);
}

.segmented button:hover { color: var(--text-1); }

.segmented button.on {
  color: var(--onbrand);
  font-weight: 500;
}

/* 滑块：靠 JS 设置 width/transform。
   JS 公式是 translateX(offsetLeft - clientLeft)，少算了 1px 左边框，这里用 left: 1px 补齐。 */
.segmented .thumb {
  position: absolute;
  left: 1px;
  top: 3px;
  bottom: 3px;
  border-radius: 7px;
  background: var(--brand);
  box-shadow: 0 2px 10px -2px var(--brand-glow);
  transition: transform 260ms var(--ease-spring), width 260ms var(--ease-spring);
  pointer-events: none;
  z-index: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar .grow { flex: 1; min-width: 0; }

/* 搜索框（带图标） */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 200px;
}

.search-box .ico {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-4);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 32px;
  padding: 0 11px 0 31px;
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text-1);
  font-size: 12.5px;
  outline: none;
  transition: border-color 150ms var(--ease-swift), box-shadow 150ms var(--ease-swift);
}

.search-box input::placeholder { color: var(--text-4); }

.search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ==========================================================================
   5. 徽标与胶囊
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-raised);
  color: var(--text-2);
  white-space: nowrap;
  letter-spacing: 0;
}

.pill .ico { width: 11px; height: 11px; }

.pill.brand { background: var(--brand-soft); color: var(--brand-text); }
.pill.ok    { background: var(--ok-soft); color: var(--ok-text); }
.pill.warn  { background: var(--warn-soft); color: var(--warn-text); }
.pill.danger{ background: var(--danger-soft); color: var(--danger-text); }
.pill.info  { background: var(--info-soft); color: var(--info-text); }
.pill.purple{ background: var(--purple-soft); color: var(--purple-text); }
.pill.muted { background: var(--bg-panel-2); color: var(--text-3); }

.pill.solid-danger { background: var(--danger); color: var(--onbrand); }

/* 竖向色条（列表左侧标记） */
.rail {
  width: 3px;
  border-radius: 2px;
  align-self: stretch;
  flex-shrink: 0;
  min-height: 16px;
}
.rail.brand  { background: var(--brand); box-shadow: 0 0 10px var(--brand-glow); }
.rail.ok     { background: var(--ok); }
.rail.warn   { background: var(--warn); }
.rail.danger { background: var(--danger); }
.rail.info   { background: var(--info); }
.rail.purple { background: var(--purple); }
.rail.muted  { background: var(--text-4); }

/* ==========================================================================
   6. 数据行（列表通用）
   ========================================================================== */

.data-list {
  display: flex;
  flex-direction: column;
}

.data-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 6px;
  border-bottom: 1px solid var(--line-faint);
  cursor: pointer;
  border-radius: 8px;
  transition: background 140ms var(--ease-swift), transform 140ms var(--ease-glide);
}

.data-row:last-child { border-bottom: none; }
.data-row:hover { background: var(--bg-panel-2); }
.data-row:active { transform: scale(0.996); }

.data-row .title {
  font-size: 13.5px;
  color: var(--text-1);
  line-height: 1.45;
  margin-bottom: 5px;
  word-break: break-word;
}

.data-row .meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-3);
}

.data-row .meta .sep {
  width: 1px;
  height: 9px;
  background: var(--line-strong);
  flex-shrink: 0;
}

.data-row .tail {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   7. 环形进度
   ========================================================================== */

.ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ring svg { transform: rotate(-90deg); }

.ring circle {
  fill: none;
  stroke-linecap: round;
}

.ring .track { stroke: var(--bg-raised); }

.ring .fill {
  transition: stroke-dasharray 700ms var(--ease-glide);
}

.ring .label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.ring.lg .label { font-size: 14px; }

/* ==========================================================================
   8. 时间线
   ========================================================================== */

.timeline {
  position: relative;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--line-strong), transparent);
}

.timeline .item {
  position: relative;
  padding: 0 0 14px;
}

.timeline .item:last-child { padding-bottom: 0; }

.timeline .item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1.5px solid var(--line-strong);
  box-sizing: content-box;
}

.timeline .item.hot::before {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.timeline .item.warn::before { border-color: var(--warn); }
.timeline .item.danger::before { border-color: var(--danger); }
.timeline .item.ok::before { border-color: var(--ok); }

.timeline .t {
  font-size: 11px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.timeline .d {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
  word-break: break-word;
}

.timeline .d b { color: var(--text-1); font-weight: 500; }

/* ==========================================================================
   9. 空状态（带插画）
   ========================================================================== */

.empty-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  gap: 4px;
}

.empty-art img {
  width: 132px;
  height: 132px;
  object-fit: contain;
  opacity: 0.72;
  margin-bottom: 6px;
  animation: floatSoft 6s ease-in-out infinite;
  will-change: transform;
}

@keyframes floatSoft {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -7px, 0); }
}

.empty-art .t {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 3px;
}

.empty-art .s {
  font-size: 12px;
  color: var(--text-4);
  max-width: 320px;
  line-height: 1.6;
}

.empty-art .act { margin-top: 13px; }

/* ==========================================================================
   10. 命令面板
   ========================================================================== */

.palette-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(3px);
  z-index: 400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 13vh;
  animation: overlayIn 140ms var(--ease-swift) both;
}

.command-palette {
  width: min(600px, calc(100vw - 32px));
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 24px 70px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
}

.command-palette .cp-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.command-palette .cp-input .ico { width: 17px; height: 17px; color: var(--text-3); flex-shrink: 0; }

.command-palette .cp-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 14.5px;
}

.command-palette .cp-input input::placeholder { color: var(--text-4); }

.command-palette .cp-list {
  max-height: 46vh;
  overflow-y: auto;
  padding: 6px;
}

.cp-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
  transition: background 110ms var(--ease-swift);
}

.cp-item .ico { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.cp-item .cp-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-item .cp-hint { font-size: 11px; color: var(--text-4); flex-shrink: 0; }

.cp-item.on,
.cp-item:hover {
  background: var(--brand-soft);
  color: var(--text-1);
}

.cp-item.on .ico { color: var(--brand-hover); }

.cp-group {
  font-size: 10.5px;
  color: var(--text-4);
  letter-spacing: 0.08em;
  padding: 9px 11px 5px;
}

.cp-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-4);
}

.cp-foot .k { display: inline-flex; align-items: center; gap: 5px; }

/* ==========================================================================
   11. 抽屉（右侧滑出）
   ========================================================================== */

.drawer-mask {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(2px);
  z-index: 260;
  animation: overlayIn 160ms var(--ease-swift) both;
}

.drawer-mask.leaving { animation: overlayOut 180ms var(--ease-swift) both; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100vw);
  background: var(--bg-panel);
  border-left: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  z-index: 261;
  animation: drawerIn 300ms var(--ease-glide) both;
  box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.8);
}

.drawer.leaving { animation: drawerIn 220ms var(--ease-swift) reverse both; }

.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.drawer-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

.drawer-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ==========================================================================
   12. 定义列表 / 键值网格
   ========================================================================== */

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 13px 18px;
}

.kv .k {
  font-size: 11px;
  color: var(--text-4);
  margin-bottom: 3px;
}

.kv .v {
  font-size: 12.5px;
  color: var(--text-1);
  word-break: break-word;
  line-height: 1.5;
}

.kv .v.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: -0.02em; }

/* ==========================================================================
   13. 表格（改进版）
   ========================================================================== */

.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-panel);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tbl thead th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.tbl tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-faint);
  vertical-align: middle;
  color: var(--text-2);
}

.tbl tbody tr:last-child td { border-bottom: none; }

.tbl tbody tr {
  transition: background 110ms var(--ease-swift);
}

.tbl tbody tr:hover { background: var(--bg-panel-2); }

.tbl .num { font-variant-numeric: tabular-nums; text-align: right; }

/* ==========================================================================
   14. 进度条行
   ========================================================================== */

.meter {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--text-3);
}

.meter .track {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-raised);
  overflow: hidden;
  min-width: 46px;
}

.meter .fill {
  height: 100%;
  border-radius: 3px;
  transition: width 700ms var(--ease-glide);
}

.meter .n {
  min-width: 26px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

/* ==========================================================================
   15. 悬浮提示
   ========================================================================== */

.tip-host { position: relative; }

.tip {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  color: var(--text-1);
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms var(--ease-swift), transform 140ms var(--ease-glide);
  z-index: 50;
  box-shadow: var(--shadow-2);
}

.tip-host:hover .tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   16. 分栏布局
   ========================================================================== */

.split {
  display: grid;
  gap: 16px;
  align-items: start;
}

.split.side-320 { grid-template-columns: minmax(0, 1fr) 320px; }
.split.side-360 { grid-template-columns: minmax(0, 1fr) 360px; }
.split.side-280 { grid-template-columns: 280px minmax(0, 1fr); }

.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack.sm { gap: 10px; }
.stack.xs { gap: 6px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }

/* ==========================================================================
   17. 骨架屏补充
   ========================================================================== */

.sk-line { height: 13px; border-radius: 5px; }
.sk-line.w40 { width: 40%; }
.sk-line.w60 { width: 60%; }
.sk-line.w80 { width: 80%; }
.sk-block { border-radius: 10px; }

/* ==========================================================================
   18. 工具类
   ========================================================================== */

.t-xs { font-size: 11px; }
.t-sm { font-size: 12px; }
.t-md { font-size: 13px; }
.t-lg { font-size: 15px; }
.t-xl { font-size: 20px; }

.c1 { color: var(--text-1); }
.c2 { color: var(--text-2); }
.c3 { color: var(--text-3); }
.c4 { color: var(--text-4); }
.c-brand { color: var(--brand-hover); }
.c-ok { color: var(--ok); }
.c-warn { color: var(--warn); }
.c-danger { color: var(--danger); }
.c-purple { color: var(--purple); }

.fw5 { font-weight: 500; }
.fw6 { font-weight: 600; }
.mono { font-family: var(--font-mono); letter-spacing: -0.02em; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.hide { display: none !important; }

.mt1 { margin-top: 4px; }
.mt2 { margin-top: 8px; }
.mt3 { margin-top: 12px; }
.mt4 { margin-top: 16px; }
.mt5 { margin-top: 24px; }

/* ==========================================================================
   20. 公共材质层：外壳、业务表面与可交互控件
   装饰与内容分层，后加载的页面样式仍可继续使用同一组主题变量。
   ========================================================================== */

.nav {
  isolation: isolate;
  box-shadow: 14px 0 44px -36px var(--brand-glow);
}

.nav::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 140% 24% at 0% 0%, var(--aurora-1), transparent 72%),
    linear-gradient(115deg, var(--surface-sheen), transparent 36%);
}

.nav-brand {
  min-height: var(--top-h);
}

.nav-brand .mark {
  width: 32px;
  height: 32px;
  overflow: visible;
  background: transparent;
  border-radius: 0;
}

.nav-brand .mark::before,
.nav-brand .mark::after { content: none; }

.nav-brand .mark svg {
  width: 32px;
  height: 32px;
  max-width: none;
  overflow: visible;
}

.nav-brand .name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.nav-brand .name em {
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.015em;
}

.nav-group-label {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
}

.nav-item {
  border: 1px solid transparent;
}

.nav-item.active {
  border-color: var(--line-faint);
  background: linear-gradient(90deg, var(--brand-soft), transparent 92%);
  box-shadow: inset 0 1px 0 var(--surface-edge);
}

.topbar {
  box-shadow: 0 12px 34px -28px var(--brand-glow);
}

.topbar .crumb b,
.topbar h1 {
  font-size: 16px;
  font-weight: 650;
}

.section-head h2,
.card-head h2,
.card-head h3 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.section-head .sub,
.card-head .hint {
  color: var(--text-3);
  font-size: 12px;
}

.card,
.tbl-wrap,
.modal,
.drawer,
.command-palette {
  background-image:
    radial-gradient(ellipse 90% 50% at 100% 0%, var(--aurora-1), transparent 72%),
    linear-gradient(145deg, var(--surface-sheen), transparent 44%);
  border-color: var(--line);
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--surface-edge);
}

.card {
  padding: 18px;
  isolation: isolate;
}

.card::before {
  z-index: 0;
}

.card > * {
  position: relative;
}

.stat {
  isolation: isolate;
  background-image:
    radial-gradient(ellipse 90% 90% at 100% 0%, var(--aurora-1), transparent 72%),
    linear-gradient(155deg, var(--stat-grad-a), var(--stat-grad-b) 82%);
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--surface-edge);
}

.stat::after {
  content: "";
  position: absolute;
  inset: auto 14px 0;
  height: 1px;
  background: linear-gradient(90deg, var(--brand-soft), transparent);
  pointer-events: none;
}

.stat .k,
.kpi-label {
  color: var(--text-3);
  font-size: 12px;
}

.stat .v,
.kpi-value {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.stat .d,
.data-row .meta,
.timeline .d,
.kv .k,
.kv .v {
  color: var(--text-3);
}

.data-row .title,
.timeline .d b,
.kv .v {
  color: var(--text-1);
}

.data-row .title {
  font-size: 14px;
  line-height: 1.6;
}

.input,
.select,
.textarea,
.search-box input {
  background-color: var(--bg-input);
  background-image: linear-gradient(145deg, var(--surface-sheen), transparent 60%);
  box-shadow: inset 0 1px 2px var(--hover-wash);
  line-height: 1.6;
}

.input:hover,
.select:hover,
.textarea:hover,
.search-box input:hover {
  border-color: var(--line-hover);
}

.input:focus,
.select:focus,
.textarea:focus,
.search-box input:focus {
  background-color: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--brand-soft), 0 8px 26px -20px var(--interactive-glow);
}

.input::placeholder,
.textarea::placeholder,
.search-box input::placeholder {
  color: var(--text-4);
  opacity: 1;
}

.btn {
  box-shadow: inset 0 1px 0 var(--surface-edge);
}

.btn.primary {
  background: linear-gradient(115deg, var(--button-bg-hover), var(--button-bg) 56%, var(--button-bg-end));
  box-shadow: 0 5px 18px -10px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(115deg, var(--button-bg), var(--button-bg-hover) 68%, var(--button-bg-end));
}

.search-trigger,
.segmented {
  background: var(--bg-glass);
  box-shadow: inset 0 1px 0 var(--surface-edge);
}

.tbl-wrap,
.table {
  color: var(--text-1);
}

.tbl thead th,
.table th {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.tbl tbody td,
.table td {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
}

.tbl tbody tr:hover,
.table tbody tr:hover {
  background: var(--hover-wash);
}

.empty-art .s,
.empty,
.hint {
  color: var(--text-3);
}

.modal,
.drawer,
.command-palette {
  background-color: var(--bg-elevated);
  box-shadow: var(--shadow-3), inset 0 1px 0 var(--surface-edge);
}

/* ==========================================================================
   19. 响应式
   ========================================================================== */

/* ==========================================================================
   运营层次增强：导航、内容表面、数字和交互各自承担明确角色。
   ========================================================================== */
.main {
  position: relative;
  isolation: isolate;
}

.page {
  position: relative;
  isolation: isolate;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, var(--shell-grid) 1px, transparent 1px),
    linear-gradient(var(--shell-grid) 1px, transparent 1px),
    radial-gradient(ellipse 70% 280px at 30% 0%, var(--shell-horizon), transparent 88%);
  background-size: 56px 56px, 56px 56px, 100% 100%;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 65%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 65%, transparent);
}

.nav {
  border-right-color: var(--panel-border);
  box-shadow: 12px 0 42px -34px var(--brand-glow);
}

.nav-brand {
  position: relative;
  background: linear-gradient(110deg, var(--surface-sheen), transparent 74%);
  border-bottom-color: var(--panel-border);
}

.nav-brand::after {
  content: "";
  position: absolute;
  inset: auto 16px 0;
  height: 1px;
  background: var(--accent-wash);
  opacity: 0.56;
  pointer-events: none;
}

.nav-group-label {
  letter-spacing: 0.12em;
}

.nav-item {
  min-height: 40px;
}

.nav-item:hover {
  background: var(--nav-item-hover);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 var(--surface-edge);
}

.nav-item.active {
  background: var(--nav-active-bg);
  border-color: var(--panel-border);
  color: var(--active-text);
  font-weight: 600;
  box-shadow: inset 0 1px 0 var(--surface-edge), 0 5px 20px -16px var(--interactive-glow);
}

.nav-item.active::before {
  width: 3px;
  background: var(--accent-wash);
}

.nav-item:focus-visible {
  background: var(--nav-item-hover);
  border-color: var(--brand-hover);
}

.topbar {
  background-image: linear-gradient(105deg, var(--surface-sheen), transparent 45%);
  border-bottom-color: var(--panel-border);
  box-shadow: 0 12px 32px -25px var(--brand-glow);
}

.topbar .crumb b,
.topbar h1 {
  font-size: 17px;
  letter-spacing: 0.015em;
}

.search-trigger:hover,
.icon-btn:hover,
.theme-toggle:hover {
  background-color: var(--nav-item-hover);
  border-color: var(--line-hover);
  color: var(--text-1);
}

.card,
.tbl-wrap,
.modal,
.drawer,
.command-palette {
  background-color: var(--panel-bg);
  border-color: var(--panel-border);
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--surface-edge);
}

.card::before {
  background: var(--card-hairline);
  opacity: 0.8;
}

.card-head {
  min-height: 30px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.section-head.ticked h2::before {
  background: var(--accent-wash);
}

.stat {
  border-color: var(--panel-border);
  background-color: var(--panel-bg);
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--surface-edge);
}

.stat .k {
  font-weight: 500;
  letter-spacing: 0.025em;
}

.stat .v,
.kpi-value {
  color: var(--text-1);
  font-size: 30px;
  font-weight: 700;
  text-shadow: none;
}

.stat.tone-brand .v { color: var(--brand-text); }
.stat.tone-info .v { color: var(--info-text); }

.data-row {
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  margin-bottom: 3px;
}

.data-row:hover {
  background: var(--queue-hover);
  border-color: var(--panel-border);
  transform: translate3d(2px, 0, 0);
}

.data-row:focus-visible,
.todo-item:focus-visible,
.user-chip:focus-visible {
  outline: 2px solid var(--brand-hover);
  outline-offset: 2px;
}

.input:focus,
.select:focus,
.textarea:focus,
.search-box input:focus {
  border-color: var(--brand-hover);
  outline: 2px solid var(--brand-soft);
  outline-offset: 1px;
}

.btn:hover:not(:disabled),
.ask-chip:hover {
  box-shadow: 0 6px 20px -13px var(--interactive-glow), inset 0 1px 0 var(--surface-edge);
}

.btn:focus-visible,
.search-trigger:focus-visible,
.icon-btn:focus-visible,
.ask-chip:focus-visible {
  outline: 2px solid var(--brand-hover);
  outline-offset: 2px;
}

.tbl thead th,
.table th {
  background: var(--panel-cap);
  color: var(--text-2);
}

.tbl tbody tr:nth-child(even),
.table tbody tr:nth-child(even) {
  background: var(--row-alt);
}

@media (max-width: 1240px) {
  .split.side-360 { grid-template-columns: minmax(0, 1fr) 300px; }
  .split.side-320 { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 1080px) {
  .split.side-320,
  .split.side-360,
  .split.side-280 { grid-template-columns: 1fr; }
}

@media (max-width: 1240px) {
  .nav:not(.pinned) { width: var(--nav-w-min); }
  .nav:not(.pinned) .nav-brand .name,
  .nav:not(.pinned) .nav-item .label,
  .nav:not(.pinned) .nav-item .count,
  .nav:not(.pinned) .nav-group-label,
  .nav:not(.pinned) .user-chip .meta { opacity: 0; pointer-events: none; }
  .nav:not(.pinned) .nav-item { justify-content: center; padding: 0; }
  .nav:not(.pinned) .nav-brand { padding: 0; justify-content: center; }
  .nav:not(.pinned) .user-chip { justify-content: center; }
  .main { margin-left: var(--nav-w-min); }

  /* 悬停临时展开，离开收回 */
  .nav:not(.pinned):hover {
    width: var(--nav-w);
    box-shadow: 22px 0 44px -22px rgba(0, 0, 0, 0.85);
  }
  .nav:not(.pinned):hover .nav-brand .name,
  .nav:not(.pinned):hover .nav-item .label,
  .nav:not(.pinned):hover .nav-item .count,
  .nav:not(.pinned):hover .nav-group-label,
  .nav:not(.pinned):hover .user-chip .meta { opacity: 1; pointer-events: auto; }
  .nav:not(.pinned):hover .nav-item { justify-content: flex-start; padding: 0 11px; }
  .nav:not(.pinned):hover .nav-brand { padding: 0 16px; justify-content: flex-start; }
  .nav:not(.pinned):hover .user-chip { justify-content: flex-start; }
}

@media (max-width: 767px) {
  .nav,
  .nav:not(.pinned) {
    top: auto;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 58px;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--line);
    box-shadow: 0 -12px 30px -18px rgba(0, 0, 0, 0.9);
  }

  .nav:hover { width: 100% !important; box-shadow: 0 -12px 30px -18px rgba(0, 0, 0, 0.9); }

  .nav-brand,
  .nav-group-label,
  .nav-foot { display: none; }

  .nav-scroll {
    display: flex;
    flex-direction: row;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .nav-scroll::-webkit-scrollbar { display: none; }

  .nav-item {
    flex: 0 0 auto;
    min-width: 64px;
    height: 58px;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    padding: 0 8px;
    justify-content: center;
    border-radius: 0;
    margin: 0;
  }

  .nav-item .label,
  .nav:not(.pinned) .nav-item .label { opacity: 1 !important; }
  .nav-item .ico { width: 19px; height: 19px; }

  .nav-item.active::before {
    left: 50%;
    top: 0;
    width: 20px;
    height: 2px;
    margin: 0 0 0 -10px;
    border-radius: 0 0 2px 2px;
  }

  .nav-item .count {
    position: absolute;
    top: 7px;
    right: 12px;
    min-width: 15px;
    height: 15px;
    font-size: 9px;
  }

  .main,
  .main.wide {
    margin-left: 0;
    padding-bottom: 58px;
  }

  .page { padding: 14px; }
  .topbar { padding: 0 13px; gap: 8px; }
  .topbar .crumb .sep { display: none; }
  .search-trigger { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat { padding: 12px; }
  .stat .v { font-size: 22px; }
  .drawer { width: 100%; }
  .palette-overlay { padding-top: 8vh; }
}
