:root {
  --bg: #0b0d11;
  --surface: #12151b;
  --surface-2: #171b23;
  --surface-hover: #1b202a;
  --input-bg: #0c0f14;
  --border: #1e232d;
  --border-strong: #2b3240;

  --text: #e5e7eb;
  --text-strong: #f9fafb;
  --text-dim: #9ca3af;
  --text-muted: #6b7280;

  --emerald: #10b981;
  --emerald-light: #34d399;
  --emerald-bg: rgba(16, 185, 129, 0.14);
  --emerald-border: rgba(16, 185, 129, 0.4);

  --blue: #60a5fa;
  --blue-hover: #93c5fd;
  --rose: #f43f5e;
  --rose-light: #fb7185;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --cyan: #38bdf8;
  --purple: #a855f7;
  --orange: #fb923c;

  --radius: 10px;
  --radius-sm: 6px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 52px;
  background: rgba(18, 21, 27, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-strong);
  font-size: 15px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-light);
}

.room-badge {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

.topbar-search {
  position: relative;
  flex: 1;
  max-width: 440px;
  margin-left: auto;
  display: flex;
  align-items: center;
}

.topbar-search .search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  height: 34px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 34px 0 33px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.topbar-search input:focus {
  border-color: var(--emerald-border);
}

.topbar-search input::placeholder {
  color: var(--text-muted);
}

.kbd-hint {
  position: absolute;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  line-height: 18px;
  pointer-events: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-tab {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all 0.15s;
}

.nav-tab:hover {
  color: var(--text-strong);
  background: var(--surface-hover);
}

.nav-tab.active {
  color: var(--emerald-light);
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  font-weight: 500;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.icon-btn.spinning .sync-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 18px 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.loading-state,
.empty-state,
.error-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-dim);
}

.error-state {
  color: var(--rose-light);
}

/* Channel View */
.channel-filter-bar {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
}

.pill-btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-btn:hover {
  color: var(--text-strong);
  background: var(--surface-hover);
}

.pill-btn.active {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald-light);
  font-weight: 500;
}

.date-range-inputs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px 8px;
  height: 30px;
}

.date-range-inputs input[type="date"] {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 12px;
  outline: none;
  color-scheme: dark;
}

.date-sep {
  color: var(--text-muted);
  font-size: 12px;
}

.inline-input,
.inline-select {
  height: 30px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}

.inline-input:focus,
.inline-select:focus {
  border-color: var(--emerald-border);
}

.indexed-count-badge {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px 12px;
  margin-bottom: 14px;
}

.summary-cell {
  text-align: center;
  padding: 2px 10px;
  border-right: 1px solid var(--border);
}

.summary-cell:last-child {
  border-right: none;
}

.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.summary-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.lives-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.live-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.live-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.live-cover {
  width: 112px;
  height: 63px;
  border-radius: 6px;
  object-fit: cover;
  background: #1a1f29;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.live-info {
  min-width: 0;
  flex: 1;
}

.live-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.live-card:hover .live-title {
  color: var(--blue-hover);
}

.live-meta {
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.live-area-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0 6px;
  border-radius: 4px;
}

.live-card-metrics {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.metric-col {
  text-align: right;
  min-width: 54px;
}

.metric-col-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.metric-col-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.metric-col-val.emerald {
  color: var(--emerald-light);
}

/* Live Detail Header */
.live-header-card {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.live-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.back-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.back-btn:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.live-header-cover {
  width: 116px;
  height: 66px;
  border-radius: 7px;
  object-fit: cover;
  background: #1a1f29;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.live-header-info {
  min-width: 0;
  flex: 1;
}

.live-header-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}

.live-header-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-strong);
}

.status-badge {
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.live-header-sub {
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.channel-chip {
  color: var(--text);
  font-weight: 500;
}

.live-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
}

.share-btn:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.stat-boxes {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.stat-box {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 74px;
  text-align: center;
}

.stat-box-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-box-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.stat-box-val.amber {
  color: var(--amber-light);
}

.stat-box-val.emerald {
  color: var(--emerald-light);
}

/* Action Toolbar */
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.toolbar-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.tab-btn.active {
  background: var(--surface-2);
  border-color: var(--emerald-border);
  color: var(--emerald-light);
  font-weight: 500;
}

.tab-count {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.export-menu-wrap {
  position: relative;
}

.export-dropdown {
  position: absolute;
  right: 0;
  top: 38px;
  min-width: 148px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 30;
}

.export-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  display: block;
}

.export-item:hover {
  background: var(--surface-hover);
  color: var(--emerald-light);
}

/* Filter Card (Screenshot 2) */
.filter-card {
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-box-wrap {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-input-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-input-box svg {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-box input {
  width: 100%;
  height: 34px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 28px 0 33px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}

.search-input-box input:focus {
  border-color: var(--emerald-border);
}

.clear-input-btn {
  position: absolute;
  right: 7px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.clear-input-btn:hover {
  color: var(--text-strong);
  background: var(--surface-hover);
}

.toggle-chip {
  height: 34px;
  padding: 0 11px;
  border-radius: 7px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.toggle-chip.active {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald-light);
  font-weight: 500;
}

.v-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
}

.price-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.price-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 120px;
}

.price-input-wrap span {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.price-input-wrap input {
  width: 100%;
  height: 34px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px 0 22px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}

.price-input-wrap input:focus {
  border-color: var(--emerald-border);
}

.price-preset-btn {
  height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.price-preset-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.price-preset-btn.active {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald-light);
}

.type-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.type-pill {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.type-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.type-pill.active {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald-light);
}

.type-pill.active .dot {
  opacity: 1;
}

.type-pill[data-group="gift"].active {
  background: rgba(244, 63, 94, 0.13);
  border-color: rgba(244, 63, 94, 0.42);
  color: var(--rose-light);
}

.type-pill[data-group="guard"].active {
  background: rgba(56, 189, 248, 0.13);
  border-color: rgba(56, 189, 248, 0.42);
  color: var(--cyan);
}

.type-pill[data-group="sc"].active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.42);
  color: var(--amber-light);
}

.type-pill[data-group="block"].active {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.42);
  color: #c084fc;
}

.type-pill[data-group="ops"].active {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--emerald-light);
}

.type-pill[data-group="enter"].active {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--text);
}

.checkbox-row {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.check-label input[type="checkbox"] {
  accent-color: var(--emerald);
  cursor: pointer;
}

.regex-error-banner {
  font-size: 12px;
  color: var(--rose-light);
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 6px;
  padding: 6px 10px;
}

.filter-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 2px;
}

/* Virtualized Danmaku Stream */
.stream-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stream-viewport {
  height: calc(100vh - 355px);
  min-height: 400px;
  max-height: 760px;
  overflow-y: auto;
  position: relative;
  padding: 6px 0;
}

.stream-spacer {
  position: relative;
  width: 100%;
}

.stream-items {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.dm-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  border-left: 2px solid transparent;
  transition: background 0.12s;
}

.dm-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.dm-row.is-focused {
  background: rgba(16, 185, 129, 0.18);
  border-left-color: var(--emerald-light);
  animation: pulseFocus 2.4s ease-out;
}

@keyframes pulseFocus {
  0% { background: rgba(16, 185, 129, 0.36); }
  100% { background: rgba(16, 185, 129, 0.12); }
}

.dm-row.is-sc {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: var(--amber);
}

.dm-row.is-guard {
  background: rgba(56, 189, 248, 0.06);
  border-left-color: var(--cyan);
}

.dm-row.is-system {
  color: var(--text-muted);
  font-size: 12.5px;
}

.dm-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
  user-select: none;
}

.dm-avatar.placeholder {
  background: transparent;
}

.dm-time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.dm-content {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.dm-user-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--blue);
  cursor: pointer;
  font-weight: 500;
}

.dm-user-btn:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

.dm-colon {
  color: var(--text-muted);
  margin: 0 5px 0 1px;
}

.dm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 0 6px;
  height: 20px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
  font-weight: 500;
}

.dm-badge.gift {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-light);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.dm-badge.guard {
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.dm-badge.sc {
  background: rgba(245, 158, 11, 0.18);
  color: var(--amber-light);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.dm-badge.block {
  background: rgba(168, 85, 247, 0.16);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.dm-badge.enter {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-dim);
}

.dm-gift-text {
  color: var(--rose-light);
}

.dm-guard-text {
  color: var(--cyan);
}

.dm-sc-text {
  color: #fde68a;
}

.dm-emoji-img {
  height: 26px;
  max-width: 96px;
  vertical-align: middle;
  border-radius: 4px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
}

.dm-copy-btn {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
  flex-shrink: 0;
}

.dm-row:hover .dm-copy-btn {
  opacity: 1;
}

.dm-copy-btn:hover {
  color: var(--text-strong);
  background: var(--surface-2);
}

mark.hl {
  background: rgba(245, 158, 11, 0.32);
  color: #fef3c7;
  padding: 0 2px;
  border-radius: 3px;
}

/* Analytics View */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analytics-card {
  padding: 16px;
}

.analytics-card.full {
  grid-column: 1 / -1;
}

.analytics-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analytics-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.chart-svg {
  width: 100%;
  height: 200px;
  display: block;
}

.chart-bar {
  fill: var(--emerald);
  opacity: 0.72;
  cursor: pointer;
  transition: opacity 0.12s;
}

.chart-bar:hover {
  opacity: 1;
}

.chart-bar.has-paid {
  fill: var(--amber);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rank-table th,
.rank-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.rank-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
}

.rank-table td.num,
.rank-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Global Search View */
.search-header-card {
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.user-banner {
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: rgba(96, 165, 250, 0.35);
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.08), rgba(16, 185, 129, 0.04));
}

.user-banner-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
}

.user-banner-meta {
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 3px;
}

.search-results-card {
  overflow: hidden;
}

.search-status-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.search-result-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s;
}

.search-result-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.search-live-link {
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.search-live-link:hover {
  color: var(--blue);
}

.search-live-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
  color: var(--text-muted);
  white-space: nowrap;
}

.jump-btn {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--emerald-light);
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--emerald-border);
  background: var(--emerald-bg);
  cursor: pointer;
}

.jump-btn:hover {
  background: rgba(16, 185, 129, 0.24);
}

.search-result-body {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
}

.pagination-bar {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn:not(:disabled):hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

/* Popover & Modal */
.popover {
  position: fixed;
  z-index: 60;
  width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 6px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.popover-header {
  padding: 6px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.popover-name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 13px;
  word-break: break-all;
}

.popover-uid {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.popover-action {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}

.popover-action:hover {
  background: var(--surface-hover);
  color: var(--emerald-light);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-title {
  margin: 0;
  font-size: 16px;
  color: var(--text-strong);
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.modal-stat {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.modal-stat-k {
  font-size: 11.5px;
  color: var(--text-muted);
}

.modal-stat-v {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-strong);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.toast.ok {
  border-color: var(--emerald-border);
  color: var(--emerald-light);
}

.toast.err {
  border-color: rgba(244, 63, 94, 0.45);
  color: var(--rose-light);
}

/* Responsive */
@media (max-width: 900px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 0;
  }
  .summary-cell:nth-child(2n) {
    border-right: none;
  }
  .live-header-card {
    flex-direction: column;
    align-items: stretch;
  }
  .live-header-right {
    align-items: flex-start;
  }
  .stat-boxes {
    flex-wrap: wrap;
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar-search {
    display: none;
  }
  .live-card {
    flex-direction: column;
    align-items: stretch;
  }
  .live-card-metrics {
    justify-content: flex-start;
  }
  .metric-col {
    text-align: left;
  }
  .checkbox-row {
    margin-left: 0;
  }
}
