/* analytics-style.css — extends Wang Console tokens for the Analytics page.
   Reuse all .wc-* tokens from style.css; add .wc-an-* for analytics-specific
   chrome. Keep the dark, restrained, slightly-Chinese-restaurant aesthetic. */

/* ─────── Page shell ─────── */
.wc-an-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(184, 42, 42, 0.05), transparent 60%),
    radial-gradient(900px 500px at 110% 30%, rgba(200, 154, 106, 0.04), transparent 70%),
    var(--wc-bg);
}

/* Top header strip with title + time filter + live indicator */
.wc-an-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--wc-line);
  background: linear-gradient(180deg, var(--wc-bg-2) 0%, transparent 100%);
}
.wc-an-head-l { display: flex; flex-direction: column; gap: 6px; }
.wc-an-crumbs {
  font-family: var(--wc-font-mono); font-size: 11px;
  color: var(--wc-text-faint); letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 6px;
}
.wc-an-crumbs em { color: var(--wc-bronze); font-style: normal; }
.wc-an-title {
  font-family: var(--wc-font-display);
  font-size: 34px; line-height: 1; letter-spacing: 0.005em;
  color: var(--wc-text-hi); font-weight: 500;
  display: flex; align-items: baseline; gap: 14px;
}
.wc-an-title-zh {
  font-family: var(--wc-font-zh);
  font-size: 28px; color: var(--wc-red); line-height: 1;
}
.wc-an-sub {
  font-family: var(--wc-font-mono); font-size: 11px;
  color: var(--wc-text-faint); letter-spacing: 0.04em;
  margin-top: 2px;
}
.wc-an-head-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* Live ping */
.wc-an-live {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px;
  background: var(--wc-bg-2);
  border: 1px solid var(--wc-line);
  border-radius: 99px;
  font-family: var(--wc-font-mono); font-size: 10.5px;
  color: var(--wc-text-dim); letter-spacing: 0.04em;
}
.wc-an-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--wc-bamboo);
  box-shadow: 0 0 0 0 rgba(107, 163, 114, 0.6);
  animation: anPulse 1.6s ease-out infinite;
}
@keyframes anPulse {
  0%   { box-shadow: 0 0 0 0   rgba(107, 163, 114, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(107, 163, 114, 0); }
  100% { box-shadow: 0 0 0 0   rgba(107, 163, 114, 0); }
}

/* Segmented time filter */
.wc-an-segment {
  display: inline-flex;
  background: var(--wc-bg-2);
  border: 1px solid var(--wc-line);
  border-radius: 4px;
  overflow: hidden;
}
.wc-an-segment button {
  height: 30px; padding: 0 14px;
  font-family: var(--wc-font-mono); font-size: 11px;
  color: var(--wc-text-dim);
  letter-spacing: 0.06em;
  border-right: 1px solid var(--wc-line);
}
.wc-an-segment button:last-child { border-right: 0; }
.wc-an-segment button:hover { color: var(--wc-text); background: var(--wc-bg-3); }
.wc-an-segment button.is-on {
  color: var(--wc-text-hi); background: var(--wc-bg-3);
  box-shadow: inset 0 -2px 0 var(--wc-red);
}

/* Grid layout for analytics cards */
.wc-an-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  padding: 18px 28px 32px;
}
.wc-an-cell { grid-column: span 12; min-width: 0; }
.wc-an-cell.col-3  { grid-column: span 3;  }
.wc-an-cell.col-4  { grid-column: span 4;  }
.wc-an-cell.col-5  { grid-column: span 5;  }
.wc-an-cell.col-6  { grid-column: span 6;  }
.wc-an-cell.col-7  { grid-column: span 7;  }
.wc-an-cell.col-8  { grid-column: span 8;  }
.wc-an-cell.col-9  { grid-column: span 9;  }
@media (max-width: 1280px) {
  .wc-an-cell.col-3 { grid-column: span 6; }
  .wc-an-cell.col-4 { grid-column: span 6; }
  .wc-an-cell.col-5 { grid-column: span 6; }
  .wc-an-cell.col-7 { grid-column: span 12; }
  .wc-an-cell.col-8 { grid-column: span 12; }
  .wc-an-cell.col-9 { grid-column: span 12; }
}

/* ─────── Card chrome ─────── */
.wc-an-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(220, 192, 156, 0.018) 0%, transparent 100%),
    var(--wc-bg-2);
  border: 1px solid var(--wc-line);
  border-radius: 4px;
  display: flex; flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.wc-an-card-h {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--wc-line);
  gap: 10px; flex-wrap: wrap;
}
.wc-an-card-h-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wc-an-card-title {
  font-family: var(--wc-font-display);
  font-size: 18px;
  color: var(--wc-text-hi);
  letter-spacing: 0.01em; line-height: 1.15;
  font-weight: 500;
}
.wc-an-card-sub {
  font-family: var(--wc-font-mono); font-size: 10.5px;
  color: var(--wc-text-faint); letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wc-an-card-meta {
  font-family: var(--wc-font-mono); font-size: 10.5px;
  color: var(--wc-text-dim);
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: flex-end;
}
.wc-an-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px;
  border: 1px solid var(--wc-line-2);
  border-radius: 2px;
  font-family: var(--wc-font-mono); font-size: 10px;
  color: var(--wc-text-dim);
}
.wc-an-tag-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--wc-bronze);
}
.wc-an-card-body {
  padding: 14px 16px 16px;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}

/* ─────── KPI cards ─────── */
.wc-an-kpi {
  position: relative;
  padding: 18px 18px 14px;
  background:
    linear-gradient(180deg, rgba(220, 192, 156, 0.025) 0%, transparent 100%),
    var(--wc-bg-2);
  border: 1px solid var(--wc-line);
  border-radius: 4px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 134px;
  overflow: hidden;
}
.wc-an-kpi::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--wc-kpi-accent, var(--wc-bronze));
  opacity: 0.7;
}
.wc-an-kpi-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.wc-an-kpi-lbl {
  font-family: var(--wc-font-mono); font-size: 10.5px;
  color: var(--wc-text-dim); letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wc-an-kpi-delta {
  font-family: var(--wc-font-mono); font-size: 10.5px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.02em;
}
.wc-an-kpi-delta.is-up   { color: var(--wc-bamboo); background: rgba(107, 163, 114, 0.10); }
.wc-an-kpi-delta.is-down { color: var(--wc-red-soft); background: rgba(184, 42, 42, 0.10); }
.wc-an-kpi-delta.is-flat { color: var(--wc-text-faint); background: var(--wc-bg-3); }
.wc-an-kpi-value {
  font-family: var(--wc-font-display);
  font-size: 46px; line-height: 1; color: var(--wc-text-hi);
  font-variant-numeric: tabular-nums; letter-spacing: 0.005em;
  font-weight: 500;
  display: flex; align-items: baseline; gap: 6px;
}
.wc-an-kpi-unit {
  font-family: var(--wc-font-mono); font-size: 13px;
  color: var(--wc-text-faint);
  font-weight: 400;
}
.wc-an-kpi-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  font-family: var(--wc-font-mono); font-size: 10.5px;
  color: var(--wc-text-faint);
  letter-spacing: 0.04em;
  margin-top: auto;
  gap: 10px;
}
.wc-an-kpi-spark { height: 30px; flex: 1; min-width: 0; }
.wc-an-kpi-mini {
  font-family: var(--wc-font-mono); font-size: 10px;
  color: var(--wc-text-faint);
  white-space: nowrap;
}

/* ─────── Stream graph ─────── */
.wc-an-chart { width: 100%; }
.wc-an-chart svg { width: 100%; height: 100%; display: block; }

.wc-an-legend {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-family: var(--wc-font-mono); font-size: 10px;
  color: var(--wc-text-dim);
  letter-spacing: 0.04em;
}
.wc-an-legend-i {
  display: inline-flex; align-items: center; gap: 5px;
}
.wc-an-legend-sw {
  width: 9px; height: 9px; border-radius: 1px;
  display: inline-block;
}

/* Crosshair / tooltip */
.wc-an-tip {
  position: absolute;
  z-index: 8;
  background: rgba(15, 10, 10, 0.96);
  border: 1px solid var(--wc-line-2);
  border-radius: 3px;
  padding: 8px 10px;
  font-family: var(--wc-font-mono);
  font-size: 10.5px;
  color: var(--wc-text);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  letter-spacing: 0.02em;
  transform: translate(-50%, -100%);
  transition: opacity 0.08s;
}
.wc-an-tip .l { color: var(--wc-text-faint); }
.wc-an-tip .v { color: var(--wc-text-hi); }
.wc-an-tip .accent { color: var(--wc-bronze); }
.wc-an-tip .red    { color: var(--wc-red-soft); }
.wc-an-tip .green  { color: var(--wc-bamboo); }
.wc-an-tip-row { display: flex; gap: 10px; justify-content: space-between; }

/* ─────── Funnel ─────── */
.wc-an-funnel {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 6px;
}
.wc-an-funnel-step {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 6px;
  border-left: 2px solid transparent;
}
.wc-an-funnel-step .n {
  font-family: var(--wc-font-mono); font-size: 10px;
  color: var(--wc-text-faint);
  text-align: right;
  letter-spacing: 0.04em;
}
.wc-an-funnel-step .lbl {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.wc-an-funnel-step .lbl b {
  font-family: var(--wc-font-display);
  font-size: 15px; color: var(--wc-text-hi);
  font-weight: 500;
}
.wc-an-funnel-step .lbl span {
  font-family: var(--wc-font-mono); font-size: 10px;
  color: var(--wc-text-faint); letter-spacing: 0.04em;
}
.wc-an-funnel-step .val {
  text-align: right;
  font-family: var(--wc-font-mono);
  color: var(--wc-text-hi); font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.wc-an-funnel-step .val em {
  font-style: normal;
  font-size: 9.5px; color: var(--wc-text-faint);
  display: block; margin-top: 1px;
  letter-spacing: 0.04em;
}
.wc-an-funnel-bar {
  position: relative;
  height: 26px; width: 100%;
  background: rgba(220, 192, 156, 0.04);
  border: 1px solid rgba(220, 192, 156, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.wc-an-funnel-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg,
    var(--wc-funnel-color, var(--wc-bronze)) 0%,
    rgba(0,0,0,0) 130%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.wc-an-funnel-drop {
  position: absolute; right: -6px; top: 50%;
  transform: translate(100%, -50%);
  font-family: var(--wc-font-mono); font-size: 9.5px;
  color: var(--wc-red-soft); letter-spacing: 0.04em;
  white-space: nowrap;
}
.wc-an-funnel-row {
  display: grid; grid-template-columns: 220px 1fr 110px;
  align-items: center; gap: 14px;
  padding: 4px 0;
}

/* ─────── Heatmap ─────── */
.wc-an-heat {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 6px;
  width: 100%;
}
.wc-an-heat-rows {
  display: flex; flex-direction: column; justify-content: space-around;
  font-family: var(--wc-font-mono); font-size: 9.5px;
  color: var(--wc-text-faint); letter-spacing: 0.04em;
  text-align: right; padding-right: 4px;
}
.wc-an-heat-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  grid-auto-rows: 16px;
  gap: 2px;
}
.wc-an-heat-cell {
  border-radius: 1px;
  position: relative;
  cursor: pointer;
  transition: outline 0.1s;
}
.wc-an-heat-cell:hover { outline: 1px solid var(--wc-text-hi); outline-offset: 0; }
.wc-an-heat-cols {
  display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px;
  margin-top: 4px;
  font-family: var(--wc-font-mono); font-size: 8.5px;
  color: var(--wc-text-faint); letter-spacing: 0.02em;
}
.wc-an-heat-cols span { text-align: center; opacity: 0.65; }
.wc-an-heat-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
  font-family: var(--wc-font-mono); font-size: 10px;
  color: var(--wc-text-faint); letter-spacing: 0.04em;
}
.wc-an-heat-scale {
  display: inline-flex; align-items: center; gap: 4px;
}
.wc-an-heat-scale-row { display: inline-flex; gap: 1.5px; }
.wc-an-heat-scale-row i {
  width: 10px; height: 10px; border-radius: 1px; display: inline-block;
}

/* ─────── Donut / radial ─────── */
.wc-an-donut-wrap {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 16px;
  align-items: center;
}
.wc-an-donut-center {
  font-family: var(--wc-font-display);
  font-size: 32px; color: var(--wc-text-hi);
  text-anchor: middle; dominant-baseline: middle;
  letter-spacing: 0.005em;
}
.wc-an-donut-center-sub {
  font-family: var(--wc-font-mono);
  font-size: 9px;
  fill: var(--wc-text-faint);
  text-anchor: middle;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.wc-an-donut-legend { display: flex; flex-direction: column; gap: 8px; }
.wc-an-donut-li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px; align-items: baseline;
  font-family: var(--wc-font-mono); font-size: 11px;
  color: var(--wc-text-dim);
}
.wc-an-donut-li i {
  width: 10px; height: 10px; border-radius: 1px; display: inline-block;
}
.wc-an-donut-li b {
  color: var(--wc-text-hi); font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.wc-an-donut-li span { color: var(--wc-text-faint); }

/* viewport stacked bar */
.wc-an-vp {
  display: flex; flex-direction: column; gap: 10px;
}
.wc-an-vp-bar {
  display: flex;
  height: 22px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--wc-line);
}
.wc-an-vp-seg {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--wc-font-mono); font-size: 10px;
  color: rgba(15, 10, 10, 0.7);
  letter-spacing: 0.04em;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.wc-an-vp-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-family: var(--wc-font-mono); font-size: 10.5px;
  color: var(--wc-text-dim); letter-spacing: 0.04em;
}
.wc-an-vp-legend i {
  width: 8px; height: 8px; border-radius: 1px;
  display: inline-block; margin-right: 6px;
}

/* ─────── Live ticker ─────── */
.wc-an-ticker {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
}
.wc-an-ticker-list {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  gap: 0;
  mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.wc-an-ticker-row {
  display: grid;
  grid-template-columns: 56px 90px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-bottom: 1px dashed var(--wc-line);
  font-family: var(--wc-font-mono); font-size: 11px;
  color: var(--wc-text-dim);
  animation: anTickerIn 0.4s ease-out both;
}
@keyframes anTickerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wc-an-ticker-row .ts {
  color: var(--wc-text-faint); font-size: 10px; letter-spacing: 0.04em;
}
.wc-an-ticker-row .ev {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: 0.04em;
  color: var(--wc-text);
}
.wc-an-ticker-row .ev .pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--wc-event-color, var(--wc-bronze));
  box-shadow: 0 0 0 0 currentColor;
}
.wc-an-ticker-row .pa {
  color: var(--wc-text); font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wc-an-ticker-row .mt {
  color: var(--wc-text-faint); font-size: 10px;
  display: flex; gap: 6px; align-items: center;
}
.wc-an-ticker-row .mt b {
  color: var(--wc-bronze); font-weight: 500;
}
.wc-an-ticker-row.is-conv { background: linear-gradient(90deg, rgba(184, 42, 42, 0.10), transparent 60%); }
.wc-an-ticker-row.is-conv .pa { color: var(--wc-red-soft); }

/* ─────── Force-directed session network ─────── */
.wc-an-net { position: relative; width: 100%; height: 400px; }
.wc-an-net svg { width: 100%; height: 100%; display: block; }

.wc-an-net-node-label {
  font-family: var(--wc-font-mono);
  font-size: 10px;
  fill: var(--wc-text);
  pointer-events: none;
  letter-spacing: 0.02em;
}
.wc-an-net-node-label.is-faint { fill: var(--wc-text-faint); }

.wc-an-net-legend {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(15, 10, 10, 0.6);
  border: 1px solid var(--wc-line);
  border-radius: 3px;
  padding: 8px 10px;
  font-family: var(--wc-font-mono);
  font-size: 10px;
  color: var(--wc-text-dim);
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 4px;
  pointer-events: none;
}
.wc-an-net-legend b { color: var(--wc-text-hi); font-weight: 500; }
.wc-an-net-legend-row {
  display: flex; align-items: center; gap: 6px;
}
.wc-an-net-legend-row i {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}

/* ─────── Chord ─────── */
.wc-an-chord { position: relative; }
.wc-an-chord svg { width: 100%; }
.wc-an-chord-arc-label {
  font-family: var(--wc-font-mono);
  font-size: 10px;
  fill: var(--wc-text);
  letter-spacing: 0.02em;
}

/* ─────── Top surfaces ─────── */
.wc-an-top {
  display: flex; flex-direction: column;
  gap: 4px;
}
.wc-an-top-row {
  display: grid;
  grid-template-columns: 26px 1fr 70px 72px;
  align-items: center; gap: 12px;
  padding: 8px 6px;
  border-bottom: 1px dashed var(--wc-line);
}
.wc-an-top-row:last-child { border-bottom: 0; }
.wc-an-top-row .n {
  font-family: var(--wc-font-mono); font-size: 10px;
  color: var(--wc-text-faint); letter-spacing: 0.04em;
}
.wc-an-top-row .nm {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.wc-an-top-row .nm b {
  font-family: var(--wc-font-mono);
  font-size: 12px; color: var(--wc-text);
  letter-spacing: 0.02em;
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wc-an-top-row .nm span {
  font-family: var(--wc-font-mono); font-size: 10px;
  color: var(--wc-text-faint); letter-spacing: 0.04em;
}
.wc-an-top-bar {
  position: relative; height: 12px;
  background: rgba(220, 192, 156, 0.05);
  border-radius: 1px;
  overflow: hidden;
}
.wc-an-top-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--wc-top-color, var(--wc-bronze)) 0%, rgba(0,0,0,0) 130%);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.wc-an-top-row .val {
  font-family: var(--wc-font-mono);
  color: var(--wc-text-hi); font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.wc-an-top-row .val em {
  font-style: normal;
  font-size: 9.5px; color: var(--wc-text-faint);
  display: block; margin-top: 1px;
}

/* ─────── Empty state hint ─────── */
.wc-an-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--wc-text-faint);
  font-family: var(--wc-font-mono); font-size: 11px;
  letter-spacing: 0.06em;
  pointer-events: none;
}

/* ─────── Mini sidebar override — analytics is the active nav item ─────── */
.wc-nav-section + .wc-nav-section { margin-top: 4px; }
.wc-an-nav-section { padding-bottom: 4px; }

/* Small monospace SVG axis text */
.wc-an-axis text {
  font-family: var(--wc-font-mono);
  font-size: 9.5px;
  fill: var(--wc-text-faint);
  letter-spacing: 0.04em;
}
.wc-an-axis line, .wc-an-axis path {
  stroke: rgba(220, 192, 156, 0.12);
  shape-rendering: crispEdges;
}
.wc-an-grid-line {
  stroke: rgba(220, 192, 156, 0.06);
  stroke-dasharray: 2 3;
  shape-rendering: crispEdges;
}

/* Stream area mouse zone */
.wc-an-stream-wrap { position: relative; width: 100%; height: 280px; }
.wc-an-stream-wrap svg { position: absolute; inset: 0; }
.wc-an-stream-cross {
  stroke: rgba(220, 192, 156, 0.5);
  stroke-dasharray: 2 3;
  pointer-events: none;
}
