/* 1. 全站设计变量：冷灰工作台与克制的 Emerald 交互色。 */
:root {
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f1f5f9;
  --bg-active: #e2e8f0;
  --ink-primary: #0f172a;
  --ink-secondary: #334155;
  --ink-muted: #64748b;
  --ink-faint: #94a3b8;
  --line-subtle: #eef2f6;
  --line-default: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #059669;
  --brand-hover: #047857;
  --brand-soft: #ecfdf5;
  --brand-border: #a7f3d0;
  --brand-ink: #065f46;
  --row-erc20-bg: #f5f9ff;
  --row-erc20-hover: #eaf3ff;
  --row-erc20-bar: #3b82f6;
  --badge-erc20-bg: #dbeafe;
  --badge-erc20-ink: #1d4ed8;
  --row-native-bg: #fffcf0;
  --row-native-hover: #fef6d8;
  --row-native-bar: #f59e0b;
  --badge-native-bg: #fef3c7;
  --badge-native-ink: #b45309;
  --row-swap-bg: #faf7ff;
  --row-swap-hover: #f2ebff;
  --row-swap-bar: #8b5cf6;
  --badge-swap-bg: #ede9fe;
  --badge-swap-ink: #6d28d9;
  --sp-bridge-bg: #f2fbf9;
  --sp-bridge-bar: #0d9488;
  --sp-bridge-badge: #ccfbf1;
  --sp-bridge-ink: #0f766e;
  --sp-wemix-bg: #fffcf2;
  --sp-wemix-bar: #d97706;
  --sp-wemix-badge: #fef3c7;
  --sp-wemix-ink: #b45309;
  --sp-stake-bg: #f5f8ff;
  --sp-stake-bar: #2563eb;
  --sp-stake-badge: #dbeafe;
  --sp-stake-ink: #1e40af;
  --sp-pool-bg: #f6fbf4;
  --sp-pool-bar: #16a34a;
  --sp-pool-badge: #dcfce7;
  --sp-pool-ink: #15803d;
  --sp-remove-bg: #fff8f3;
  --sp-remove-bar: #ea580c;
  --sp-remove-badge: #ffedd5;
  --sp-remove-ink: #c2410c;
  --sp-watch-bg: #fdf7ff;
  --sp-watch-bar: #9333ea;
  --sp-watch-badge: #f3e8ff;
  --sp-watch-ink: #7e22ce;
  --ok-bg: #dcfce7;
  --ok-ink: #15803d;
  --warn-bg: #fef3c7;
  --warn-ink: #b45309;
  --err-bg: #fee2e2;
  --err-ink: #b91c1c;
  --info-bg: #e0f2fe;
  --info-ink: #0369a1;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 4%);
  --shadow-pop: 0 10px 30px -5px rgb(15 23 42 / 14%), 0 4px 10px -2px rgb(15 23 42 / 6%);
  --shadow-drawer: -12px 0 40px rgb(15 23 42 / 16%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font: 12.5px/1.5 var(--font-sans);
}

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

button, summary, a {
  -webkit-tap-highlight-color: transparent;
}

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

a:hover {
  color: var(--brand-hover);
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .42;
  cursor: default;
}

input, select, textarea {
  min-width: 0;
  max-width: 100%;
  color: var(--ink-primary);
  background: white;
  border: 1px solid var(--line-default);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
}

input, select {
  height: 32px;
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

input::placeholder, textarea::placeholder {
  color: var(--ink-faint);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-border);
  outline-offset: 1px;
  border-color: var(--brand);
}

input[type="checkbox"] {
  accent-color: var(--brand);
  width: 14px;
  height: 14px;
  margin: 0;
}

button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.4px;
}

h2 {
  font-size: 16px;
  font-weight: 650;
}

h3 {
  font-size: 13px;
  font-weight: 650;
}

.muted, .field-hint, .hint {
  color: var(--ink-muted);
}

.field-hint, .hint {
  font-size: 11px;
  line-height: 1.7;
}

.mono, .money, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sub {
  display: block;
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

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

.icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  vertical-align: middle;
  pointer-events: none;
}

[data-icon] {
  display: inline-flex;
  align-items: center;
}

.rotate-180, .rotate-180 .icon {
  transform: rotate(180deg);
}

.button-group, .panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn, .icon-btn, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn {
  min-height: 32px;
  border: 1px solid var(--line-default);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: background .15s, border-color .15s;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--line-strong);
}

.btn.primary, .primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.btn.primary:hover, .primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
}

.icon-btn {
  width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  padding: 3px;
  color: var(--ink-muted);
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
}

.icon-btn:hover {
  color: var(--ink-primary);
  background: var(--bg-active);
}

.icon-btn.copied {
  color: var(--brand);
  background: var(--brand-soft);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--brand-ink);
  font-size: 11px;
  padding: 3px;
}

.badge, .count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

.badge {
  padding: 2px 6px;
  font-size: 10.5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.badge.ok, .status-chip.ok {
  color: var(--ok-ink);
  background: var(--ok-bg);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.badge.error {
  background: var(--err-bg);
  color: var(--err-ink);
}

.badge.info {
  background: var(--info-bg);
  color: var(--info-ink);
}

.count-badge {
  padding: 0 5px;
  line-height: 18px;
  font: 10px/18px var(--font-mono);
  background: var(--bg-subtle);
  border-radius: 4px;
  color: var(--ink-muted);
}

/* 2. 统一壳层：顶栏48px，二级导航38px，避免巨型首屏指标。 */
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 48px;
  padding: 0 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line-default);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.2px;
}

.brand-mark {
  display: block;
  width: 12px;
  height: 20px;
  transform: skew(-19deg);
  background: var(--brand);
  border-radius: 1px;
}

.product-switch {
  display: flex;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: 6px;
  gap: 2px;
}

.product-switch a {
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  color: var(--ink-muted);
}

.product-switch a.active {
  background: white;
  border-radius: 4px;
  color: var(--ink-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.top-links {
  display: flex;
  gap: 14px;
  color: var(--ink-muted);
  font-size: 11px;
}

.top-links a {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-links .icon {
  width: 12px;
  height: 12px;
}

.header-state {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid var(--line-default);
  border-radius: 20px;
  color: var(--ink-muted);
  white-space: nowrap;
  font-size: 10.5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  display: inline-block;
}

.status-chip.connected {
  color: var(--brand-ink);
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

.connected .status-dot {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgb(5 150 105 / 7%);
}

.auth-button {
  font-size: 11px;
  min-height: 28px;
  height: 28px;
}

.subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 20px;
  gap: 16px;
  background: white;
  border-bottom: 1px solid var(--line-default);
}

.viewnav {
  display: flex;
  gap: 22px;
  min-width: 0;
}

.viewnav button {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0;
  color: var(--ink-muted);
  background: transparent;
  white-space: nowrap;
  font-size: 12px;
}

.viewnav button.active {
  color: var(--brand-ink);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.metrics-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-muted);
  font-size: 10px;
  white-space: nowrap;
}

.metrics-inline b {
  font: 11px var(--font-mono);
  color: var(--ink-secondary);
  margin-left: 4px;
}

.workspace {
  padding: 12px 20px 28px;
  max-width: 1920px;
  margin: 0 auto;
}

.view {
  min-width: 0;
}

.view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0 16px;
}

.view-heading p {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* 3. 混合筛选条、条件胶囊与清晰的快照状态。 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  margin-bottom: 2px;
}

.search-input {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  min-width: 150px;
  max-width: 360px;
}

.search-input > .icon, .search-input > [data-icon] {
  position: absolute;
  left: 10px;
  color: var(--ink-faint);
}

.search-input input {
  width: 100%;
  padding-left: 32px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--line-default);
  border-radius: 6px;
  background: white;
  gap: 1px;
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 11px;
  padding: 4px 8px;
  min-height: 26px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.segmented button:hover {
  color: var(--ink-primary);
  background: var(--bg-hover);
}

.segmented button.active {
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-weight: 600;
}

.type-dot {
  display: inline-block;
  height: 6px;
  width: 6px;
  border-radius: 50%;
  flex: 0 0 6px;
}

.type-dot.erc20 {
  background: var(--row-erc20-bar);
}

.type-dot.native {
  background: var(--row-native-bar);
}

.type-dot.swap {
  background: var(--row-swap-bar);
}

.quick-field select {
  width: 116px;
}

.quick-range {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-faint);
}

.quick-range input {
  width: 86px;
}

.amount-presets {
  display: flex;
  gap: 2px;
}

.amount-presets button {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 4px;
  font: 10px var(--font-mono);
  border-radius: 4px;
}

.amount-presets button:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.address-role-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  font-size: 11px;
}

.address-role-bar .segmented button {
  padding: 1px 8px;
  min-height: 24px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
}

.toolbar-leading, .toolbar-trailing {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.toolbar-leading {
  flex: 1;
  flex-wrap: wrap;
}

.toolbar-trailing {
  flex-shrink: 0;
}

.list-count {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.toolbar-trailing select {
  height: 28px;
  padding: 4px 6px;
  font-size: 10.5px;
  max-width: 132px;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-muted);
}

.auto-control {
  white-space: nowrap;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.filter-chips button, .chip {
  padding: 3px 6px;
  border: 1px solid var(--brand-border);
  border-radius: 4px;
  color: var(--brand-ink);
  background: var(--brand-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  max-width: 200px;
}

.filter-chips button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-chips .icon {
  height: 11px;
  width: 11px;
}

.live-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--brand-ink);
  white-space: nowrap;
}

.live-state.pending {
  color: var(--warn-ink);
}

.live-state .status-dot {
  background: currentColor;
}

.snapshot-banner, .notice-banner, .error-banner {
  border: 1px solid var(--line-default);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 7px 0;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.snapshot-banner, .notice-banner.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.error-banner {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--err-ink);
}

.snapshot-banner .btn {
  min-height: 26px;
  padding: 3px 7px;
  font-size: 10.5px;
  background: white;
}

.mobile-more-label {
  display: none;
}

.column-popover {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 330px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: white;
  border: 1px solid var(--line-default);
  border-radius: 9px;
  padding: 14px;
  box-shadow: var(--shadow-pop);
  color: var(--ink-primary);
}

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

.panel-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

/* 4. 高密度列表：固定列布局，1280px桌面不需要横向滚动。 */
.table-shell {
  background: white;
  border: 1px solid var(--line-default);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  height: 36px;
  padding: 7px 8px;
  background: var(--bg-subtle);
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--line-default);
  vertical-align: middle;
}

.data-table th button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  padding: 0;
  max-width: 100%;
  white-space: nowrap;
}

.data-table th .icon {
  width: 11px;
  height: 11px;
  color: var(--ink-faint);
}

.data-table th button.filtered {
  color: var(--brand-ink);
}

.data-table td {
  position: relative;
  height: 48px;
  padding: 3px 8px;
  font-size: 12px;
  border-bottom: 1px solid var(--line-subtle);
  vertical-align: middle;
  overflow: hidden;
  min-width: 0;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table .record-row {
  cursor: pointer;
  background: var(--row-bg, white);
}

.data-table .record-row:hover, .data-table .record-row.active {
  background: var(--row-hover, var(--bg-hover));
}

.data-table .record-row.active {
  outline: 1px solid var(--brand-border);
  outline-offset: -1px;
}

.data-table .record-row > td:first-child {
  box-shadow: inset 3px 0 0 var(--row-bar, transparent);
  padding-left: 12px;
}

.type-erc20 {
  --row-bg: var(--row-erc20-bg);
  --row-hover: var(--row-erc20-hover);
  --row-bar: var(--row-erc20-bar);
}

.type-native {
  --row-bg: var(--row-native-bg);
  --row-hover: var(--row-native-hover);
  --row-bar: var(--row-native-bar);
}

.type-swap {
  --row-bg: var(--row-swap-bg);
  --row-hover: var(--row-swap-hover);
  --row-bar: var(--row-swap-bar);
}

.type-erc20 .kind-badge {
  background: var(--badge-erc20-bg);
  color: var(--badge-erc20-ink);
}

.type-native .kind-badge {
  background: var(--badge-native-bg);
  color: var(--badge-native-ink);
}

.type-swap .kind-badge {
  background: var(--badge-swap-bg);
  color: var(--badge-swap-ink);
}

.amount-cell {
  text-align: right;
}

.amount-cell > button {
  justify-content: flex-end;
  width: 100%;
}

.money {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.money .asset-symbol {
  color: var(--ink-secondary);
  font-size: 10.5px;
  font-weight: 500;
  margin-left: 4px;
}

.money-output {
  font-size: 10px;
  color: var(--ink-muted);
  font-weight: 400;
}

.transaction-end {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.transaction-end .tx-chip {
  flex: 1;
  min-width: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 0;
  font-size: 11px;
  color: var(--ink-muted);
}

.pagination > .muted:first-child {
  margin-right: auto;
}

.pagination .btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.coverage {
  border-top: 1px solid var(--line-default);
  color: var(--ink-muted);
  padding: 12px 0;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.9;
}

.coverage summary {
  cursor: pointer;
  color: var(--ink-secondary);
}

.coverage > div, .coverage > p {
  margin-top: 7px;
}

.empty {
  text-align: center;
  padding: 44px 20px !important;
  color: var(--ink-muted);
}

.empty h2 {
  margin: 8px 0;
}

.management-lock {
  background: white;
  border: 1px solid var(--line-default);
  border-radius: 8px;
}

.management-lock .btn {
  margin-top: 12px;
}

.mobile-list {
  display: none;
}

.loading {
  opacity: .58;
  transition: opacity .12s;
  pointer-events: none;
}

.global-progress {
  position: fixed;
  z-index: 100;
  height: 2px;
  top: 0;
  left: 0;
  width: 35%;
  background: var(--brand);
  animation: progress 1s ease-in-out infinite;
}

@keyframes progress {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(400%);
  }
}

/* 5. 地址实体组件，始终保留尾号，动作与外链清晰分离。 */
.address-chip {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.address-main {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  line-height: 16px;
}

.address-label {
  max-width: 145px;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.address-tail {
  color: var(--ink-faint);
  font: 10px var(--font-mono);
  flex-shrink: 0;
}

.address-main:hover .address-label {
  color: var(--brand-hover);
}

.address-code {
  font: 10.5px var(--font-mono);
}

.entity-actions {
  display: flex;
  align-items: center;
  height: 24px;
  gap: 2px;
}

.entity-actions .icon-btn {
  height: 22px;
  min-height: 22px;
  width: 24px;
  color: #7b8b9f;
}

.entity-actions .icon {
  height: 13px;
  width: 13px;
}

.tx-chip {
  display: inline-flex;
  align-items: center;
  flex-direction: column;
  max-width: 100%;
}

.tx-link {
  font: 10.5px/16px var(--font-mono);
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tx-link:hover {
  color: var(--brand);
}

.tx-chip .entity-actions {
  height: 22px;
}

.full-address {
  font: 11px/1.7 var(--font-mono);
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

/* 6. 详情右侧检视器、手机底部面板与推送快照。 */
dialog {
  color: var(--ink-primary);
  border: 1px solid var(--line-default);
  padding: 0;
  background: white;
  box-shadow: var(--shadow-pop);
  max-width: calc(100vw - 24px);
}

dialog::backdrop {
  background: rgb(15 23 42 / 24%);
  backdrop-filter: blur(1px);
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: 640px;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line-default);
  box-shadow: var(--shadow-drawer);
}

.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: drawer-enter .18s ease-out;
}

.drawer-head {
  flex: 0 0 auto;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-default);
}

.drawer-head p {
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-muted);
}

.drawer-head .eyebrow {
  font-size: 10px;
  color: var(--ink-muted);
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  flex: 1;
}

.drawer-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line-default);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: white;
  flex-shrink: 0;
}

.drawer-body h3 {
  margin: 20px 0 10px;
}

.drawer-body details {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-default);
}

.drawer-body details summary {
  cursor: pointer;
  color: var(--ink-secondary);
  font-weight: 500;
}

.drawer-body pre {
  max-width: 100%;
  overflow: auto;
  background: var(--bg-subtle);
  border-radius: 6px;
  padding: 14px;
  font: 11px/1.7 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-hero {
  background: var(--bg-canvas);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line-subtle);
}

.detail-hero .hero-amount {
  display: block;
  font: 600 22px/1.4 var(--font-mono);
  margin: 10px 0;
  overflow-wrap: anywhere;
}

.detail-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: 14px;
}

.detail-flow .address-chip {
  max-width: 100%;
}

.detail-grid {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  margin: 18px 0;
  row-gap: 12px;
  font-size: 12px;
}

.detail-grid dt {
  color: var(--ink-muted);
}

.detail-grid dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-grid .tx-chip {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.detail-grid .entity-actions {
  height: 24px;
}

.panel-dialog {
  border-radius: 12px;
  width: 460px;
}

.panel-dialog .drawer-body {
  max-height: 70dvh;
}

.panel-dialog .form-grid {
  grid-template-columns: 1fr;
}

.address-menu-actions, #address-menu-actions {
  display: grid;
  gap: 8px;
}

.address-menu-actions .btn, #address-menu-actions .btn {
  justify-content: flex-start;
  min-height: 42px;
}

.notice-dialog {
  width: 480px;
  border-radius: 14px;
  padding-bottom: 16px;
}

.notice-dialog .drawer-head {
  border: 0;
  min-height: 52px;
  padding-bottom: 8px;
}

.notice-caption {
  font-size: 10.5px;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: 5px;
  margin: 0 20px 12px;
  padding: 7px 9px;
}

.notice-caption.snapshot {
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  border-color: var(--line-default);
}

.push-card {
  margin: 0 20px;
  background: #f2f4f7;
  border: 1px solid #e9edf2;
  padding: 14px;
  border-radius: 12px;
}

.push-app {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.push-app > span:last-child {
  margin-left: auto;
}

.push-app .icon {
  background: var(--brand);
  color: white;
  border-radius: 3px;
  height: 20px;
  width: 20px;
  padding: 3px;
}

.push-card h3 {
  font-size: 15px;
  font-weight: 650;
}

.push-card > p {
  font-size: 11px;
  color: var(--ink-secondary);
  margin: 6px 0 10px;
}

#notice-body {
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notice-footer {
  padding: 10px 20px 0;
  font-size: 10px;
  color: var(--ink-muted);
}

.notice-footer .btn {
  margin-top: 10px;
}

@keyframes drawer-enter {
  from {
    transform: translateX(32px);
    opacity: .7;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 7. 规则目录与保存协调器。关闭的规则不占用常驻大表单。 */
.channel-panel {
  padding: 12px 14px;
  border: 1px solid var(--line-default);
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.channel-main, .channel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-icon {
  display: grid;
  place-items: center;
  height: 32px;
  width: 32px;
  border-radius: 6px;
  color: var(--brand-ink);
  background: var(--brand-soft);
}

.channel-main strong {
  font-size: 12px;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  font-size: 11px;
}

.switch-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  width: 30px;
  height: 18px;
  border-radius: 20px;
  background: #cbd5e1;
  position: relative;
  transition: background .15s;
  display: inline-block;
}

.switch-track::after {
  content: "";
  width: 14px;
  height: 14px;
  position: absolute;
  top: 2px;
  left: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 2px #0002;
  transition: transform .15s;
}

.switch-label input:checked + .switch-track {
  background: var(--brand);
}

.switch-label input:checked + .switch-track::after {
  transform: translateX(12px);
}

.switch-label input:focus-visible + .switch-track {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.channel-actions details {
  position: relative;
}

.channel-actions summary {
  list-style: none;
}

.credential-fields {
  position: absolute;
  z-index: 10;
  top: 40px;
  right: 0;
  width: 310px;
  padding: 14px;
  border: 1px solid var(--line-default);
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  display: grid;
  gap: 12px;
}

.auth-note {
  margin: 7px 0 12px;
  font-size: 10.5px;
  color: var(--ink-muted);
}

.rule-segments {
  margin-bottom: 14px;
}

.rule-segments button {
  padding: 5px 12px;
  font-size: 12px;
}

.rules-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.rule-list {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.rule-item {
  border: 1px solid var(--line-default);
  border-radius: 6px;
  background: white;
  min-width: 0;
}

.rule-summary {
  min-height: 44px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rule-summary-title {
  font-size: 12px;
  font-weight: 600;
  min-width: 120px;
}

.normal-summary-text {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.rule-summary-condition {
  color: var(--ink-muted);
  font-size: 11px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.normal-advanced {
  margin-top: 14px;
  border-top: 1px solid var(--line-default);
  padding-top: 12px;
}

.normal-advanced summary {
  cursor: pointer;
  font-size: 11px;
  margin-bottom: 12px;
}

.related-event {
  border: 1px solid var(--line-default);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.related-event.active {
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

.related-event > .mono {
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.rule-summary .rule-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rule-actions .btn {
  font-size: 11px;
  min-height: 26px;
  padding: 3px 7px;
}

.rule-expanded {
  padding: 15px;
  background: #fafbfd;
  border-top: 1px solid var(--line-subtle);
}

.rule-fields, .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
  color: var(--ink-muted);
}

.field > input, .field > select, .field > textarea {
  width: 100%;
}

.field textarea {
  min-height: 74px;
}

.field.wide, .form-grid > .wide {
  grid-column: 1 / -1;
}

.field-hint {
  font-weight: 400;
}

.settings-form {
  max-width: 560px;
  display: grid;
  gap: 16px;
  background: white;
  border: 1px solid var(--line-default);
  padding: 20px;
  border-radius: 8px;
}

.settings-form .btn {
  justify-self: start;
}

.dirty-bar {
  position: fixed;
  z-index: 35;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(840px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: #0f172a;
  color: white;
  border-radius: 9px;
  padding: 12px 16px;
  box-shadow: 0 8px 30px #0f172a33;
  animation: dirty-enter .16s ease-out;
}

.dirty-bar strong {
  font-size: 12px;
}

.dirty-bar .sub {
  color: #aab9cc;
  margin-top: 2px;
}

.dirty-bar .btn.ghost {
  color: #e2e8f0;
}

body.has-dirty {
  padding-bottom: 86px;
}

.dirty-bar .btn {
  min-height: 30px;
  font-size: 11px;
}

.sync-status {
  color: var(--ink-muted);
  font-size: 11px;
  margin-bottom: 10px;
  line-height: 1.8;
}

.alias-table td {
  height: 54px;
}

.alias-table .address-chip {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.alias-table .address-label {
  max-width: 260px;
}

.alias-table .full-address {
  margin-top: 3px;
}

.notice-link {
  color: var(--ink-primary);
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
}

.notice-link:hover {
  color: var(--brand);
}

.alert-table td {
  padding: 9px 10px;
  height: 56px;
  overflow-wrap: anywhere;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 150;
  max-width: calc(100vw - 32px);
  padding: 10px 15px;
  color: white;
  background: #0f172a;
  border-radius: 7px;
  box-shadow: var(--shadow-pop);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@keyframes dirty-enter {
  from {
    opacity: 0;
    margin-bottom: -12px;
  }

  to {
    opacity: 1;
    margin-bottom: 0;
  }
}

/* 8. 平板和手机：列表变为三行记录，编辑与筛选为底部面板。 */
@media (max-width: 1390px) {
  .topbar {
    gap: 15px;
  }

  .metrics-inline {
    gap: 9px;
  }

  .metrics-inline .metric-secondary {
    display: none;
  }

  .amount-presets {
    display: none;
  }

  .search-input {
    flex-basis: 210px;
  }
}

@media (max-width: 1023px) {
  .top-links {
    display: none;
  }

  .subnav {
    flex-wrap: wrap;
    gap: 0;
  }

  .metrics-inline {
    width: 100%;
    min-height: 28px;
    padding-bottom: 5px;
  }

  .desktop-filter {
    display: none;
  }

  .drawer {
    width: 86vw;
  }

  .live-state {
    display: none;
  }

  .rule-summary-condition {
    max-width: 240px;
  }
}

@media (max-width: 767px) {
  html {
    scroll-padding-top: 60px;
  }

  .topbar {
    height: 48px;
    padding: 0 12px;
    gap: 10px;
  }

  .brand {
    font-size: 13px;
    gap: 5px;
  }

  .brand-mark {
    width: 9px;
    height: 16px;
  }

  .product-switch a {
    font-size: 10.5px;
    padding: 4px 6px;
  }

  .header-state {
    gap: 5px;
  }

  #demo-indicator {
    display: none;
  }

  #connection {
    border: 0;
    padding: 0;
    background: transparent;
  }

  #connection .connection-text {
    display: none;
  }

  #auth-trigger {
    height: 30px;
    width: 30px;
    padding: 6px;
  }

  #auth-trigger .auth-label {
    display: none;
  }

  .subnav {
    padding: 0 12px;
    overflow: hidden;
  }

  .viewnav {
    overflow-x: auto;
    width: 100%;
    gap: 20px;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 94%, transparent);
  }

  .viewnav::-webkit-scrollbar {
    display: none;
  }

  .viewnav button {
    font-size: 12px;
    flex-shrink: 0;
  }

  .metrics-inline {
    gap: 12px;
    font-size: 9px;
    min-height: 27px;
  }

  .metrics-inline b {
    font-size: 10px;
  }

  .metrics-inline .metric-secondary {
    display: none;
  }

  .workspace {
    padding: 10px 12px 24px;
  }

  .filter-bar {
    flex-wrap: wrap;
    gap: 7px;
  }

  .search-input {
    max-width: none;
    min-width: 0;
    flex: 1 1 calc(100% - 82px);
  }

  .filter-bar .type-segments {
    order: 3;
    width: 100%;
  }

  .type-segments button {
    flex: 1;
  }

  .mobile-more-label {
    display: inline;
  }

  .desktop-more-label {
    display: none;
  }

  .list-toolbar {
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px 0;
  }

  .toolbar-leading {
    flex-basis: 100%;
  }

  .toolbar-trailing {
    margin-left: auto;
    max-width: 100%;
  }

  .toolbar-trailing select {
    max-width: 128px;
  }

  .auto-control {
    font-size: 10px;
  }

  .address-role-bar {
    flex-wrap: wrap;
  }

  .address-role-bar .segmented {
    flex: 1;
  }

  .address-role-bar .segmented button {
    flex: 1;
    font-size: 10px;
  }

  .data-table {
    display: none;
  }

  .table-shell {
    border-radius: 7px;
  }

  .mobile-list {
    display: block;
  }

  .mobile-row {
    display: flex;
    flex-direction: column;
    min-height: 88px;
    gap: 5px;
    padding: 9px 10px 7px 12px;
    border-bottom: 1px solid var(--line-default);
    border-left: 3px solid var(--row-bar, transparent);
    background: var(--row-bg, white);
    cursor: pointer;
    min-width: 0;
  }

  .mobile-row:last-child {
    border-bottom: 0;
  }

  .mobile-row.active {
    outline: 1px solid var(--brand);
    outline-offset: -1px;
  }

  .mobile-row .mobile-top, .mobile-row .mobile-flow, .mobile-row .mobile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }

  .mobile-top .money {
    font-size: 12px;
  }

  .mobile-top .money-output {
    font-size: 10px;
  }

  .mobile-row .mobile-kind {
    flex: 0 0 auto;
    font-size: 10px;
  }

  .mobile-row .mobile-flow {
    color: var(--ink-muted);
    font-size: 10px;
    justify-content: flex-start;
  }

  .mobile-flow .address-chip {
    flex: 1;
    min-width: 0;
  }

  .mobile-flow .address-main {
    max-width: 100%;
  }

  .mobile-flow .entity-actions {
    display: none;
  }

  .mobile-flow .address-label {
    font-size: 10.5px;
    max-width: 110px;
  }

  .mobile-flow .address-tail {
    font-size: 9px;
  }

  .mobile-meta {
    font: 9px var(--font-mono);
    color: var(--ink-muted);
  }

  .mobile-meta .tx-chip {
    flex-direction: row;
    align-items: center;
    gap: 2px;
  }

  .mobile-meta .tx-link {
    font-size: 9px;
  }

  .mobile-meta .entity-actions {
    height: 24px;
  }

  .mobile-meta .icon-btn {
    height: 24px;
    width: 24px;
    flex-basis: 24px;
  }

  .mobile-meta .tx-chip .entity-actions [data-search] {
    display: none;
  }

  .mobile-meta .transaction-end {
    flex-shrink: 0;
  }

  .icon-btn {
    min-height: 32px;
    height: 32px;
    width: 32px;
    flex-basis: 32px;
  }

  .address-chip .entity-actions .icon-btn {
    min-height: 28px;
    height: 28px;
    width: 30px;
  }

  .address-main {
    min-height: 24px;
  }

  .snapshot-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .snapshot-banner .btn {
    width: 100%;
  }

  .pagination {
    gap: 10px;
    padding: 12px 0;
  }

  .pagination .btn {
    min-height: 34px;
  }

  .pagination > .muted:first-child {
    display: none;
  }

  .drawer, .panel-dialog, .notice-dialog {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 88dvh;
    margin: 0;
    border: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 40px #0f172a26;
  }

  .drawer[open], .panel-dialog[open], .notice-dialog[open] {
    display: flex;
    flex-direction: column;
    animation: sheet-enter .18s ease-out;
  }

  .drawer::before, .panel-dialog::before, .notice-dialog::before {
    content: "";
    display: block;
    width: 32px;
    height: 4px;
    border-radius: 4px;
    background: var(--line-strong);
    margin: 7px auto -5px;
    flex-shrink: 0;
  }

  .drawer-head {
    padding: 14px 16px;
    min-height: 58px;
  }

  .drawer-body {
    padding: 16px;
  }

  .drawer-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .drawer-body.form-grid, .form-grid, .rule-fields {
    grid-template-columns: 1fr;
  }

  .drawer-head h2 {
    font-size: 15px;
  }

  .detail-hero {
    padding: 12px;
  }

  .detail-hero .hero-amount {
    font-size: 18px;
  }

  .detail-grid {
    grid-template-columns: 78px minmax(0, 1fr);
    font-size: 11px;
  }

  .detail-grid .tx-chip {
    flex-wrap: wrap;
  }

  .detail-flow {
    grid-template-columns: 1fr;
  }

  .detail-flow > .icon {
    transform: rotate(90deg);
    margin-left: 8px;
  }

  .push-card {
    margin: 0 16px;
  }

  .notice-caption {
    margin-left: 16px;
    margin-right: 16px;
  }

  .notice-dialog {
    padding-bottom: 16px;
  }

  #notice-body {
    font-size: 11px;
    max-height: 40dvh;
    overflow: auto;
  }

  .notice-footer {
    padding: 10px 16px 0;
  }

  .notice-footer .btn {
    width: 100%;
  }

  .column-popover {
    inset: auto 0 0 !important;
    width: 100%;
    max-width: 100%;
    max-height: 88dvh;
    border-radius: 16px 16px 0 0;
    padding: 18px 16px;
  }

  .view-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .view-heading h1 {
    font-size: 18px;
  }

  .view-heading p {
    font-size: 11px;
  }

  .channel-panel {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px;
  }

  .channel-main {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .channel-icon {
    display: none;
  }

  .channel-actions {
    flex-wrap: wrap;
    gap: 7px;
  }

  .channel-actions .btn {
    min-height: 32px;
    font-size: 11px;
  }

  .credential-fields {
    position: static;
    width: 100%;
    margin-top: 10px;
    box-shadow: none;
  }

  .channel-actions details[open] {
    flex-basis: 100%;
    order: 5;
  }

  .rule-segments {
    width: 100%;
  }

  .rule-segments button {
    flex: 1;
    padding: 5px 7px;
    font-size: 11px;
  }

  .rules-toolbar {
    flex-wrap: wrap;
  }

  .rules-toolbar .btn {
    min-height: 32px;
    font-size: 10px;
    padding: 5px 7px;
  }

  .rule-summary {
    min-height: 64px;
    padding: 10px;
    gap: 8px;
  }

  .normal-summary-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .rule-summary-title {
    min-width: 0;
    font-size: 12px;
  }

  .rule-summary-condition {
    white-space: normal;
    font-size: 10px;
    max-width: none;
  }

  .rule-summary .rule-actions .desktop-action {
    display: none;
  }

  .rule-summary .rule-actions {
    gap: 1px;
  }

  .rule-expanded {
    padding: 12px;
  }

  .dirty-bar {
    left: 0;
    bottom: 0;
    transform: none;
    border-radius: 10px 10px 0 0;
    width: 100%;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
    gap: 8px;
  }

  .dirty-bar > .button-group {
    width: 100%;
    justify-content: flex-end;
    gap: 5px;
  }

  .dirty-bar .btn {
    padding: 5px 8px;
    font-size: 10.5px;
  }

  body.has-dirty {
    padding-bottom: 120px;
  }

  .settings-form {
    padding: 16px;
  }

  #toast {
    bottom: 18px;
    width: max-content;
    max-width: calc(100vw - 24px);
    font-size: 11px;
  }

  .alias-mobile-record, .alert-mobile-record {
    padding: 12px;
    border-bottom: 1px solid var(--line-default);
  }

  .alias-mobile-record .full-address {
    font-size: 9px;
  }

  .alias-mobile-record .address-chip {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .alert-mobile-record {
    display: grid;
    gap: 7px;
  }

  .alert-mobile-record .record-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 10px;
  }
}

@keyframes sheet-enter {
  from {
    opacity: .65;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* 特殊规则：紧凑业务目录与单行摘要。 */
.special-rules-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 8px;
}

.special-rules-search {
  position: relative;
  flex: 1 1 240px;
  max-width: 400px;
}

.special-rules-search > svg {
  position: absolute;
  left: 9px;
  top: 9px;
  color: var(--ink-muted);
  pointer-events: none;
}

.special-rules-search .input {
  width: 100%;
  padding-left: 30px;
}

.special-rules-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 12px;
}

.special-rules-groups .chip, .special-rules-toolbar .chip {
  font-size: 11px;
}

.special-rules-groups .chip > span, .special-rules-toolbar .chip > span {
  opacity: .65;
  font-variant-numeric: tabular-nums;
}

.special-rule-group {
  margin: 0 0 10px;
}

.special-rule-group h3 {
  margin: 0;
}

.special-rule-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.special-rule-group-title small {
  margin-left: 3px;
  color: var(--ink-muted);
  font-weight: 400;
}

.special-rule-group-title[aria-expanded="true"] > svg {
  transform: rotate(90deg);
}

.special-rules-directory .rule-list {
  overflow: hidden;
  border: 1px solid var(--line-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.special-rule-item + .special-rule-item {
  border-top: 1px solid var(--line-subtle);
}

.special-rule-summary {
  display: grid;
  grid-template-columns: 32px minmax(155px, 1fr) minmax(180px, 1.3fr) minmax(0, .9fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 3px 10px;
}

.special-rule-summary:hover {
  background: var(--bg-hover);
}

.special-rule-name {
  display: block;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
}

.special-rule-name strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-rule-mobile-condition {
  display: none;
}

.special-rule-condition, .special-rule-note {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-rule-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.special-rule-actions .btn {
  height: 28px;
  padding: 4px 7px;
  font-size: 11px;
}

.special-rule-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  cursor: pointer;
}

.special-rule-switch input {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.special-rule-switch > span {
  display: block;
  width: 30px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--bg-active);
  pointer-events: none;
  transition: background .15s, border-color .15s;
}

.special-rule-switch > span::after {
  display: block;
  width: 12px;
  height: 12px;
  margin: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px #0f172a22;
  content: "";
  transition: transform .15s;
}

.special-rule-switch input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
}

.special-rule-switch input:checked + span::after {
  transform: translateX(12px);
}

.special-rule-switch input:focus-visible + span {
  outline: 2px solid var(--brand-border);
  outline-offset: 2px;
}

.special-rule-expanded {
  padding: 14px 16px;
  border-top: 1px solid var(--line-default);
  background: var(--bg-canvas);
}

.special-rule-base-fields, .special-rule-advanced-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.special-rule-wide {
  grid-column: span 1;
}

.special-rule-field-help {
  align-self: center;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.6;
}

.special-rule-editor-fields textarea {
  min-height: 64px;
  resize: vertical;
}

.special-rule-editor-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.special-rule-editor-enabled {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--ink-secondary);
  font-size: 11px;
}

.special-rule-advanced {
  margin-top: 12px;
  border-top: 1px solid var(--line-default);
}

.special-rule-advanced > summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  color: var(--ink-secondary);
  font-size: 11px;
  cursor: pointer;
  list-style: none;
}

.special-rule-advanced[open] > summary > svg {
  transform: rotate(90deg);
}

.special-rule-help {
  font-size: 11px;
  line-height: 1.7;
}

.special-rule-editor-actions, .special-rules-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.special-rule-editor-actions {
  padding-top: 12px;
}

.special-rule-editor-actions .btn {
  font-size: 11px;
}

.special-rules-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 18px;
}

.special-rules-footer > p {
  flex: 1 1 280px;
  margin: 0;
  font-size: 11px;
}

.special-rules-footer .error {
  color: var(--err-ink);
}

.special-rule-draft {
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 10px;
}

.special-rule-item.is-highlighted {
  outline: 2px solid var(--brand-border);
  outline-offset: -2px;
  animation: rule-highlight 1s ease 2;
}

.special-rule-editor-eyebrow {
  margin: 0 0 4px;
  color: var(--ink-muted);
  font-size: 11px;
}

.special-rule-editor-footer {
  display: block;
}

.special-rule-editor-footer > p {
  margin: 0 0 8px;
  font-size: 11px;
}

.special-rule-editor-footer > div {
  display: flex;
  gap: 8px;
}

@keyframes rule-highlight {
  50% {
    outline-color: var(--brand);
  }
}

@media (max-width: 1023px) {
  .special-rule-summary {
    grid-template-columns: 32px minmax(160px, 1fr) minmax(150px, 1fr) auto;
  }

  .special-rule-note {
    display: none;
  }
}

@media (max-width: 767px) {
  .special-rules-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .special-rules-search {
    grid-column: 1 / -1;
    max-width: none;
  }

  .special-rules-toolbar > .muted {
    justify-self: end;
    font-size: 11px;
  }

  .special-rules-toolbar > #special-rules-reload {
    display: none;
  }

  .special-rules-groups {
    gap: 5px;
    padding-bottom: 8px;
  }

  .special-rules-groups .chip {
    min-height: 30px;
    padding: 5px 8px;
  }

  .special-rule-summary {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
    min-height: 66px;
    padding: 8px 10px;
  }

  .special-rule-switch {
    grid-column: 2;
    grid-row: 1;
    width: 42px;
    height: 36px;
  }

  .special-rule-switch > span {
    width: 38px;
    height: 22px;
  }

  .special-rule-switch > span::after {
    width: 16px;
    height: 16px;
  }

  .special-rule-switch input:checked + span::after {
    transform: translateX(16px);
  }

  .special-rule-name {
    grid-column: 1;
    grid-row: 1;
  }

  .special-rule-name strong {
    font-size: 12px;
  }

  .special-rule-mobile-condition {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: var(--ink-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .special-rule-condition, .special-rule-note, .special-rule-actions, .special-rule-expanded {
    display: none !important;
  }

  .special-rule-base-fields, .special-rule-advanced-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .special-rule-editor-context {
    gap: 7px;
  }

  .special-rule-editor-enabled {
    width: 100%;
    margin-left: 0;
    padding: 6px 0;
  }

  .special-rule-editor-fields .input {
    min-height: 42px;
    font-size: 14px;
  }

  .special-rule-editor-fields textarea {
    min-height: 76px;
  }

  .special-rule-editor-footer > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #special-rule-editor-save {
    grid-column: span 2;
  }

  .special-rules-footer-actions {
    width: 100%;
  }

  .special-rules-footer-actions .btn {
    flex: 1;
    min-height: 38px;
    padding: 7px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .special-rule-item.is-highlighted, .special-rule-switch > span, .special-rule-switch > span::after {
    animation: none;
    transition: none;
  }
}

/* 特殊业务工作区：紧凑宽表、分角色资金与手机三行卡。 */
#special .sp-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 8px;
}

#special .sp-heading h1 {
  display: inline;
  margin-right: 12px;
  font-size: 15px;
}

#special .sp-heading .muted {
  font-size: 11px;
}

.sp-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-search {
  flex: 1 1 210px;
  min-width: 160px;
}

.sp-search input {
  width: 100%;
  min-width: 0;
}

.sp-families {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sp-families .chip {
  font-size: 11px;
  padding: 4px 8px;
  white-space: nowrap;
}

.sp-desktop-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.sp-desktop-filters > select {
  width: 150px;
  min-width: 0;
}

.sp-desktop-filters > input {
  width: 105px;
  min-width: 0;
}

.sp-presets, .sp-watched {
  display: flex;
  gap: 4px;
}

.sp-presets .chip, .sp-watched .chip {
  padding: 3px 7px;
  font-size: 10px;
  white-space: nowrap;
}

.sp-watched {
  margin-left: auto;
}

.sp-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
}

.sp-meta, .sp-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-meta {
  font-size: 11px;
  min-width: 0;
}

.sp-controls {
  flex-shrink: 0;
}

.sp-controls select {
  width: auto;
  min-width: 0;
  font-size: 11px;
}

.sp-error {
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--err-ink);
  background: var(--err-bg);
  border-radius: var(--radius-sm);
}

.sp-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.sp-table th, .sp-table td {
  min-width: 0;
  max-width: 0;
  overflow: hidden;
}

.sp-table td {
  height: 48px;
  padding: 4px 8px;
  vertical-align: middle;
}

.sp-table th > button {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.sp-table th > button svg {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  opacity: .65;
}

.sp-table th > button.filtered {
  color: var(--brand);
}

.sp-table th.sp-amount > button {
  justify-content: flex-end;
}

.sp-table .badge {
  max-width: 100%;
  font-size: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.sp-summary {
  font-size: 10px;
  line-height: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-table td.sp-entity-cell {
  padding: 0 6px;
}

.sp-entity-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 48px;
  min-width: 0;
}

.sp-entity-line {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  min-height: 24px;
  min-width: 0;
}

.sp-entity-prefix {
  flex: 0 0 11px;
  font-size: 9px;
  line-height: 14px;
  color: var(--ink-muted);
}

.sp-entity-line .address-chip {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.sp-entity-line .address-main {
  max-width: 100%;
  height: 24px;
}

.sp-entity-line .address-label {
  font-size: 10.5px;
}

.sp-entity-line .address-tail {
  font-size: 9px;
}

.sp-entity-line .entity-actions {
  display: none;
}

.sp-entity-line .sp-entity-menu {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
}

.sp-entity-menu .icon {
  transform: rotate(90deg);
  width: 12px;
  height: 12px;
}

.sp-entity-popover {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 280px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 12px;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--line-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
}

.sp-entity-popover::backdrop {
  background: transparent;
}

.sp-entity-menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.sp-entity-popover .address-chip {
  max-width: 100%;
}

.sp-entity-popover .entity-actions {
  display: flex;
  gap: 8px;
  height: 32px;
  margin-top: 5px;
}

.sp-entity-popover .entity-actions .icon-btn {
  height: 28px;
  width: 30px;
  min-height: 28px;
}

.sp-entity-full {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  margin-top: 5px;
  font: 10px/1.6 var(--font-mono);
  color: var(--ink-muted);
}

.sp-amount {
  text-align: right;
}

.sp-asset {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  line-height: 17px;
}

.sp-role {
  font-size: 9px;
  font-weight: 400;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.sp-asset .money {
  min-width: 0;
  font: 600 11px/17px var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-symbol {
  font-size: 10px;
  font-weight: 450;
}

.sp-extra-assets {
  display: block;
  font-size: 8px;
  line-height: 10px;
  color: var(--ink-muted);
  text-align: right;
}

.sp-hash {
  position: relative;
  padding-right: 16px;
  min-width: 0;
}

.sp-hash .tx-chip {
  min-width: 0;
  max-width: 100%;
}

.sp-hash .sp-open {
  position: absolute;
  right: -5px;
  top: 8px;
  width: 20px;
  height: 24px;
}

.sp-hash .entity-actions {
  gap: 0;
}

.sp-hash .entity-actions .icon-btn {
  width: 21px;
  height: 20px;
}

.sp-row {
  cursor: pointer;
}

.sp-row:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.sp-status-ok {
  color: var(--ok-ink);
  background: var(--ok-bg);
}

.sp-status-warn {
  color: var(--warn-ink);
  background: var(--warn-bg);
}

.sp-status-error {
  color: var(--err-ink);
  background: var(--err-bg);
}

.sp-status-info {
  color: var(--info-ink);
  background: var(--info-bg);
}

.tint-bridge {
  --tint-bg: var(--sp-bridge-bg);
  --tint-bar: var(--sp-bridge-bar);
  --tint-badge: var(--sp-bridge-badge);
  --tint-ink: var(--sp-bridge-ink);
}

.tint-wemix {
  --tint-bg: var(--sp-wemix-bg);
  --tint-bar: var(--sp-wemix-bar);
  --tint-badge: var(--sp-wemix-badge);
  --tint-ink: var(--sp-wemix-ink);
}

.tint-stake {
  --tint-bg: var(--sp-stake-bg);
  --tint-bar: var(--sp-stake-bar);
  --tint-badge: var(--sp-stake-badge);
  --tint-ink: var(--sp-stake-ink);
}

.tint-pool {
  --tint-bg: var(--sp-pool-bg);
  --tint-bar: var(--sp-pool-bar);
  --tint-badge: var(--sp-pool-badge);
  --tint-ink: var(--sp-pool-ink);
}

.tint-remove {
  --tint-bg: var(--sp-remove-bg);
  --tint-bar: var(--sp-remove-bar);
  --tint-badge: var(--sp-remove-badge);
  --tint-ink: var(--sp-remove-ink);
}

.tint-watch {
  --tint-bg: var(--sp-watch-bg);
  --tint-bar: var(--sp-watch-bar);
  --tint-badge: var(--sp-watch-badge);
  --tint-ink: var(--sp-watch-ink);
}

.sp-row td, .sp-mobile-row, .sp-hero {
  background: var(--tint-bg);
}

.sp-row td:first-child {
  box-shadow: inset 3px 0 var(--tint-bar);
}

.sp-row .sp-type-badge, .sp-mobile-row .badge {
  color: var(--tint-ink);
  background: var(--tint-badge);
}

.sp-row:hover td {
  filter: brightness(.986);
}

.sp-row.selected td {
  background-image: linear-gradient(#0596690d, #0596690d);
}

.sp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
}

.sp-pagination > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-pagination .muted {
  font-size: 10px;
}

.sp-pagination .btn {
  font-size: 11px;
}

.sp-coverage {
  margin-top: 14px;
  border-top: 1px solid var(--line-default);
  padding-top: 10px;
  color: var(--ink-muted);
  font-size: 11px;
}

.sp-coverage summary {
  cursor: pointer;
}

.sp-coverage p {
  line-height: 1.7;
  margin: 8px 0;
}

.sp-filter-popover {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 400px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  border: 1px solid var(--line-default);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: var(--shadow-pop);
}

.sp-filter-popover::backdrop {
  background: transparent;
}

.sp-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sp-filter-head h2 {
  font-size: 14px;
  margin: 0;
}

.sp-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sp-filter-fields > :only-child {
  grid-column: 1 / -1;
}

.sp-filter-fields .field, .sp-filter-fields input, .sp-filter-fields select {
  width: 100%;
  min-width: 0;
}

.sp-filter-hint {
  margin: 12px 0;
  font-size: 11px;
  line-height: 1.6;
}

.sp-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

.sp-drawer-actions, .sp-badges {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sp-detail .drawer-head h2 {
  font-size: 17px;
  margin: 4px 0 0;
}

.sp-hero {
  padding: 16px;
  border-left: 3px solid var(--tint-bar);
  border-radius: var(--radius-md);
}

.sp-hero p {
  margin: 10px 0;
  color: var(--ink-secondary);
  font-size: 12px;
}

.sp-detail-assets {
  margin: 12px 0 16px;
}

.sp-asset-full {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 2px 8px;
  padding: 8px 0;
  border-top: 1px solid #0f172a0d;
}

.sp-asset-full .sp-role {
  font-size: 11px;
}

.sp-asset-full .money {
  font: 600 17px/1.5 var(--font-mono);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
}

.sp-asset-full .sp-symbol {
  font-size: 13px;
}

.sp-raw {
  grid-column: 2;
  font-size: 9px;
  text-align: right;
  overflow-wrap: anywhere;
}

.sp-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.sp-flow .address-chip {
  max-width: 100%;
}

.sp-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.sp-detail-meta > div {
  min-width: 0;
}

.sp-lifecycle {
  margin-top: 16px;
  border: 1px solid var(--line-default);
  border-radius: var(--radius-md);
  padding: 14px;
}

.sp-lifecycle h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.sp-lifecycle p {
  margin: 8px 0;
  font-size: 12px;
}

.sp-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-stages .btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  padding: 9px 12px;
  text-align: left;
}

.sp-stages .btn .sub {
  margin-top: 4px;
  font-size: 10px;
}

.sp-stages .primary .sub {
  color: #ffffffcc;
}

.sp-boundary {
  color: var(--ink-muted);
  line-height: 1.7;
  padding-top: 6px;
}

.sp-related {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-default);
}

.sp-related h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.sp-related-count {
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.7;
}

.sp-related-list {
  display: grid;
  gap: 6px;
}

.sp-related-list .btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: auto;
  padding: 8px 10px;
  gap: 14px;
  text-align: left;
}

.sp-related-list .selected {
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

.sp-related-ordinary {
  margin-top: 12px;
  font-size: 11px;
}

.sp-related-ordinary > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-subtle);
  padding: 7px 0;
}

.sp-draft {
  margin-top: 18px;
}

.sp-draft-hint {
  margin-top: 8px;
  font-size: 11px;
}

.sp-evidence {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line-default);
}

.sp-evidence summary {
  font-size: 12px;
  cursor: pointer;
}

.sp-evidence > button {
  margin-top: 10px;
}

.sp-evidence pre {
  background: var(--bg-subtle);
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 420px;
  overflow: auto;
  font: 11px/1.6 var(--font-mono);
}

.sp-mobile-list {
  display: none;
}

@media (min-width: 768px) and (max-width: 1100px) {
  .sp-families .chip {
    font-size: 10px;
    padding-inline: 6px;
  }

  .sp-search {
    min-width: 130px;
  }

  .sp-presets {
    display: none;
  }

  .sp-desktop-filters > select {
    width: 125px;
  }

  .sp-watched .chip {
    font-size: 9px;
  }
}

@media (max-width: 767px) {
  #special .sp-heading h1 {
    font-size: 15px;
    margin: 0;
  }

  #special .sp-heading .muted {
    display: none;
  }

  #special .sp-heading .btn {
    font-size: 11px;
    padding-inline: 8px;
  }

  .sp-filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .sp-search {
    min-width: 0;
  }

  .sp-search input {
    font-size: 13px;
  }

  .sp-families {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    overflow-x: auto;
    gap: 4px;
    scrollbar-width: none;
    padding-bottom: 3px;
  }

  .sp-families::-webkit-scrollbar {
    display: none;
  }

  .sp-families .chip {
    flex-shrink: 0;
    font-size: 10px;
    padding: 4px 7px;
  }

  #special-more {
    grid-column: 2;
    grid-row: 1;
    font-size: 11px;
    padding-inline: 9px;
  }

  .sp-desktop-filters, .sp-table-shell {
    display: none;
  }

  .sp-mobile-list {
    display: block;
    width: 100%;
  }

  .sp-list-toolbar {
    min-height: 38px;
    gap: 5px;
  }

  .sp-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    font-size: 10px;
  }

  .sp-meta .status-chip {
    font-size: 9px;
    max-width: 165px;
  }

  .sp-controls {
    gap: 3px;
  }

  .sp-controls select {
    max-width: 76px;
    font-size: 10px;
    padding-inline: 5px;
    height: 30px;
  }

  #special-limit {
    max-width: 57px;
  }

  #special-auto, #special-csv {
    width: 28px;
    height: 30px;
    padding: 0;
  }

  #special-csv span {
    display: none;
  }

  .sp-mobile-row {
    position: relative;
    min-height: 84px;
    margin-bottom: 6px;
    padding: 8px 9px 6px;
    border: 1px solid var(--line-subtle);
    border-left: 3px solid var(--tint-bar);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }

  .sp-mobile-row.selected {
    outline: 1px solid var(--brand);
  }

  .sp-mobile-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .sp-mobile-top .badge {
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .sp-mobile-top .money {
    min-width: 0;
    text-align: right;
    font: 600 12px/1.5 var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sp-mobile-top .money small {
    color: var(--ink-muted);
    font-size: 9px;
  }

  .sp-mobile-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr);
    gap: 5px;
    align-items: center;
    padding-top: 3px;
  }

  .sp-mobile-flow .address-chip, .sp-mobile-flow .address-main {
    min-width: 0;
    max-width: 100%;
  }

  .sp-mobile-flow .entity-actions {
    display: none;
  }

  .sp-mobile-flow .address-label {
    font-size: 11px;
  }

  .sp-mobile-flow .address-tail {
    font-size: 9px;
  }

  .sp-mobile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: var(--ink-muted);
    font-size: 9px;
    white-space: nowrap;
  }

  .sp-mobile-meta > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sp-mobile-meta .tx-chip {
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .sp-mobile-meta .tx-chip .entity-actions {
    display: none;
  }

  .sp-mobile-meta .tx-chip a {
    font: 9px var(--font-mono);
  }

  .sp-mobile-meta > .icon-btn {
    width: 22px;
    height: 20px;
    min-height: 20px;
    flex: 0 0 22px;
  }

  .sp-pagination {
    gap: 5px;
    padding-top: 8px;
  }

  .sp-pagination .muted {
    font-size: 9px;
    max-width: 90px;
  }

  .sp-pagination > div {
    gap: 7px;
  }

  .sp-pagination .btn {
    min-height: 32px;
    padding-inline: 8px;
    font-size: 10px;
  }

  .sp-pagination .mono {
    font-size: 10px;
  }

  .sp-filter-fields {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .sp-filter-fields input, .sp-filter-fields select {
    height: 42px;
    font-size: 14px;
  }

  .sp-filter-actions {
    position: sticky;
    bottom: 0;
    margin-inline: -16px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-top: 1px solid var(--line-default);
  }

  .sp-filter-actions .btn {
    flex: 1;
    min-height: 40px;
  }

  .sp-detail .drawer-head h2 {
    font-size: 15px;
  }

  .sp-hero {
    padding: 12px;
  }

  .sp-flow {
    grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
    gap: 5px;
  }

  .sp-flow .entity-actions {
    display: none;
  }

  .sp-asset-full {
    grid-template-columns: 55px minmax(0, 1fr);
  }

  .sp-asset-full .money {
    font-size: 14px;
  }

  .sp-asset-full .sp-symbol {
    font-size: 11px;
  }

  .sp-raw {
    font-size: 8px;
  }

  .sp-detail-meta {
    grid-template-columns: 1fr;
  }

  .sp-related-list .btn {
    gap: 6px;
    align-items: flex-start;
  }

  .sp-related-list .btn > span:first-child {
    font-size: 11px;
  }

  .sp-related-list .money {
    font-size: 10px;
  }

  .sp-related-list .sp-asset {
    flex-wrap: wrap;
    gap: 2px;
  }

  .sp-draft {
    width: 100%;
  }
}

/* 追加：桌面实体行直接操作；每个实体24px，双实体仍为48px。 */
@media (min-width: 768px) {
  .sp-entity-line {
    gap: 2px;
  }

  .sp-entity-line .sp-entity-prefix {
    flex: 0 0 9px;
    font-size: 8px;
  }

  .sp-entity-line .address-chip {
    flex-direction: row;
    align-items: center;
    gap: 1px;
    overflow: visible;
  }

  .sp-entity-line .address-main {
    flex: 1 1 auto;
    min-width: 0;
    gap: 1px;
    overflow: hidden;
  }

  .sp-entity-line .address-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sp-entity-line .address-tail {
    flex: 0 0 auto;
    font-size: 9px;
    white-space: nowrap;
  }

  .sp-entity-line .entity-actions {
    display: flex;
    flex: 0 0 72px;
    width: 72px;
    height: 24px;
    gap: 0;
  }

  .sp-entity-line .entity-actions .icon-btn {
    flex: 0 0 24px;
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0;
  }
}

/* 手机交易行：类型与Router同排，避免把三行记录拉成大卡片。 */
@media (max-width: 767px) {
  #feed .mobile-row {
    gap: 4px;
    padding: 7px 9px 6px 10px;
    min-height: 84px;
  }
  #feed .mobile-kind {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 44%;
  }
  #feed .mobile-kind .badge {
    font-size: 9px;
    line-height: 1.3;
    flex-shrink: 0;
  }
  #feed .mobile-kind .sub {
    display: inline;
    font-size: 9px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  #feed .mobile-top > .amount-cell {
    min-width: 0;
    max-width: 56%;
    margin-left: auto;
  }
  #feed .mobile-top .money {
    line-height: 1.4;
  }
  #feed .mobile-top .money-output {
    line-height: 1.2;
  }
  #feed .mobile-flow .address-main {
    min-height: 20px;
  }
  #feed .mobile-meta .icon-btn {
    min-height: 24px;
  }
  .drawer .field input:not([type="checkbox"]),
  .drawer .field select,
  .panel-dialog .field input:not([type="checkbox"]) {
    min-height: 42px;
    font-size: 14px;
  }
}


/* PNIX 工作区：复用全站tokens，不改变其他标签页。 */
.pnix-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  min-height: 32px;
}

.pnix-heading-row > .muted {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.pnix-modes {
  flex-shrink: 0;
}

.pnix-modes button {
  min-width: 84px;
}

.pnix-quick-filters {
  display: flex;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 8px;
}

.pnix-quick-filters > .search-input {
  flex: 1;
  min-width: 180px;
  max-width: none;
}

.pnix-quick-select {
  flex: 0 1 144px;
  min-width: 100px;
}

.pnix-quick-select select {
  width: 100%;
  text-overflow: ellipsis;
}

.pnix-market-select {
  flex-basis: 240px;
  min-width: 160px;
}

.pnix-action-select {
  flex-basis: 128px;
}

#pnix-more {
  flex-shrink: 0;
}

#pnix-filter-count:empty {
  display: none;
}

#pnix-filter-chips {
  max-width: 650px;
}

.pnix-table {
  width: 100%;
  table-layout: fixed;
}

.pnix-col-time {
  width: 10%;
}

.pnix-col-type {
  width: 15%;
}

.pnix-col-pair {
  width: 16%;
}

.pnix-col-owner {
  width: 18%;
}

.pnix-col-base {
  width: 15%;
}

.pnix-col-quote {
  width: 14%;
}

.pnix-col-hash {
  width: 12%;
}

.pnix-table th > button {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  border: 0;
  background: transparent;
}

.pnix-table th > button .icon {
  width: 11px;
  height: 11px;
  color: var(--ink-faint);
}

.pnix-table th:nth-child(5) > button,
.pnix-table th:nth-child(6) > button {
  margin-left: auto;
}

.pnix-table td {
  height: 48px;
  padding: 5px 8px;
  overflow: hidden;
  vertical-align: middle;
}

.pnix-row {
  cursor: pointer;
  transition: background-color 120ms ease;
  background: #fbfcfd;
}

.pnix-side-buy {
  --pnix-side-bar: #34a58a;
  background: #f3faf7;
}

.pnix-side-sell {
  --pnix-side-bar: #d58c8c;
  background: #fff8f7;
}

.pnix-side-neutral {
  --pnix-side-bar: #a2adbc;
}

.pnix-row > td:first-child {
  box-shadow: inset 3px 0 0 var(--pnix-side-bar, #a2adbc);
}

.pnix-row:hover,
.pnix-row.selected,
.pnix-mobile-row.selected {
  background: #eaf3f1;
}

.pnix-row:focus-visible,
.pnix-mobile-row:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.pnix-table strong {
  font-size: 11.5px;
  font-weight: 600;
}

.pnix-table .sub {
  font-size: 10px;
  line-height: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnix-table .money {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}

.pnix-table .sub .money {
  font-size: 10px;
  font-weight: 400;
}

.pnix-table .address-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  gap: 3px;
  height: 24px;
}

.pnix-table .address-main {
  flex: 1 1 auto;
  min-width: 0;
}

.pnix-table .address-label {
  min-width: 0;
  font-size: 10.5px;
}

.pnix-table .entity-actions {
  flex-shrink: 0;
  gap: 0;
}

.pnix-table .entity-actions .icon-btn {
  width: 22px;
}

.pnix-table .transaction-end {
  gap: 2px;
}

.pnix-table .transaction-end > .icon-btn {
  flex-shrink: 0;
  width: 20px;
}

.pnix-order-link {
  display: inline;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--brand-hover);
  font: inherit;
  cursor: pointer;
  text-align: left;
  overflow-wrap: anywhere;
}

.pnix-order-link:hover {
  text-decoration: underline;
}

.pnix-state {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  background: #eaf1f7;
  color: #475569;
}

.pnix-state-open,
.pnix-state-partial {
  background: #dcf5eb;
  color: #14795c;
}

.pnix-state-cancelled,
.pnix-state-removed {
  background: #f6e9e7;
  color: #985c57;
}

.pnix-state-unknown {
  background: #fff1d9;
  color: #90641b;
}

.pnix-semantics {
  padding-top: 10px;
  color: var(--ink-muted);
  font-size: 11px;
}

.pnix-semantics p {
  max-width: 960px;
  margin-top: 8px;
  line-height: 1.7;
}

.pnix-mobile-rows {
  display: none;
}

.pnix-detail-intro,
.pnix-inspect-summary,
.pnix-result-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.pnix-detail-intro > strong {
  display: block;
  flex-basis: 100%;
  margin-top: 2px;
}

.pnix-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 12px 0 18px;
}

.pnix-detail-field {
  min-width: 0;
}

.pnix-detail-field > .muted {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}

.pnix-detail-field > div {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.pnix-detail-field .money {
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.pnix-boundary {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 2px solid #cbd5e1;
  background: #f8fafc;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.7;
}

.pnix-related-orders {
  display: grid;
  gap: 8px;
}

.pnix-related-orders > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-subtle);
}

.pnix-lifecycle {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pnix-lifecycle li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 7px 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-subtle);
  font-size: 11px;
}

.pnix-lifecycle li > .tx-chip {
  grid-column: 1 / -1;
}

.pnix-lifecycle .money {
  font-size: 11px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pnix-inspect-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.pnix-inspect-form .field {
  min-width: 0;
}

.pnix-inspect-form input {
  width: 100%;
  min-width: 0;
}

.pnix-cancel-result {
  padding: 16px 0;
  border-top: 1px solid var(--line-default);
}

.pnix-cancel-result .field textarea {
  resize: vertical;
  width: 100%;
  min-height: 86px;
  font: 11px/1.6 var(--font-mono);
  overflow-wrap: anywhere;
  word-break: break-all;
}

.pnix-simulation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 2px solid #d1a758;
  background: #fffaf0;
  padding: 10px 12px;
  color: #86632a;
  font-size: 11px;
  line-height: 1.6;
}

.pnix-simulation.passed {
  border-color: #38a580;
  background: #f0fbf5;
  color: #217454;
}

.pnix-copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pnix-evidence > .btn {
  margin-top: 10px;
}

@media (max-width: 1100px) and (min-width: 768px) {
  .pnix-action-select {
    display: none;
  }
  .pnix-market-select {
    flex-basis: 200px;
  }
}

@media (max-width: 767px) {
  .pnix-heading-row {
    gap: 8px;
    margin-bottom: 8px;
  }
  .pnix-heading-row > .muted {
    display: none;
  }
  #pnix-inspect-open {
    margin-left: auto;
    min-height: 32px;
    font-size: 11px;
  }
  .pnix-modes button {
    min-width: 74px;
    padding: 6px 10px;
  }
  .pnix-quick-filters {
    flex-wrap: wrap;
    gap: 6px;
  }
  .pnix-quick-filters > .search-input {
    flex-basis: calc(100% - 84px);
    min-width: 0;
    order: 0;
  }
  #pnix-more {
    order: 1;
    min-width: 70px;
  }
  .pnix-quick-select {
    display: none;
  }
  #pnix-filter-chips {
    max-width: 100%;
  }
  #pnix .toolbar-trailing {
    width: 100%;
    justify-content: flex-end;
    gap: 7px;
  }
  #pnix-live {
    margin-right: auto;
    font-size: 10px;
  }
  #pnix-table {
    display: none;
  }
  .pnix-mobile-rows {
    display: grid;
    gap: 6px;
  }
  .pnix-mobile-row {
    min-width: 0;
    padding: 7px 9px 6px 10px;
    border: 1px solid var(--line-subtle);
    border-left: 3px solid var(--pnix-side-bar, #a2adbc);
    border-radius: 5px;
    display: grid;
    gap: 2px;
    cursor: pointer;
  }
  .pnix-mobile-top,
  .pnix-mobile-middle,
  .pnix-mobile-owner,
  .pnix-mobile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }
  .pnix-mobile-top .badge {
    font-size: 10px;
  }
  .pnix-mobile-top .money {
    font-size: 12px;
  }
  .pnix-mobile-amount {
    min-width: 0;
    max-width: 62%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    white-space: nowrap;
  }
  .pnix-mobile-middle {
    font-size: 10px;
    line-height: 16px;
    color: var(--ink-muted);
  }
  .pnix-mobile-middle > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pnix-mobile-middle > span:last-child {
    flex-shrink: 0;
  }
  .pnix-mobile-middle strong {
    color: var(--ink-secondary);
  }
  .pnix-mobile-owner > .address-chip {
    max-width: 49%;
  }
  .pnix-mobile-owner > .sub {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: right;
    font-size: 10px;
  }
  .pnix-mobile-owner > .sub .money {
    display: inline;
    font-size: 10px;
  }
  .pnix-mobile-owner .address-main {
    min-height: 20px;
  }
  .pnix-mobile-row .address-chip .entity-actions {
    display: none;
  }
  .pnix-mobile-meta {
    min-height: 22px;
    font-size: 9.5px;
    color: var(--ink-muted);
  }
  .pnix-mobile-meta > span:first-child {
    flex: 1;
  }
  .pnix-mobile-meta .tx-chip {
    flex-direction: row;
    align-items: center;
    max-width: 45%;
    gap: 3px;
  }
  .pnix-mobile-meta .tx-chip .entity-actions {
    height: 22px;
  }
  .pnix-mobile-meta .tx-chip [data-search] {
    display: none;
  }
  .pnix-mobile-meta .icon-btn {
    min-height: 24px;
    height: 24px;
    width: 26px;
  }
  .pnix-detail-grid {
    gap: 12px;
  }
  .pnix-detail-field .address-label {
    max-width: 100%;
  }
  .pnix-detail .drawer-footer {
    font-size: 10px;
    align-items: center;
    justify-content: space-between;
  }
  .pnix-inspect-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .pnix-inspect-form .btn {
    justify-self: end;
  }
  .pnix-inspect-form input,
  .pnix-filter-dialog input,
  .pnix-filter-dialog select {
    min-height: 42px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pnix-row,
  .pnix-mobile-row {
    transition: none;
  }
}

/* 同一Hash只留主要记录，完整资金明细由交易抽屉承载。 */
#feed .tx-compact-row > td { height: 48px; white-space: nowrap; }
#feed .tx-compact-row .sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tx-brief-money { display: inline-flex; align-items: baseline; min-width: 0; gap: 3px; white-space: nowrap; }
.tx-brief-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tx-brief-money .asset-symbol { flex-shrink: 0; margin-left: 0; }
@media (max-width: 767px) {
  #feed .tx-compact-mobile { display: grid; grid-template-rows: 22px 24px; min-height: 55px; gap: 0; padding: 4px 7px 4px 8px; }
  .tx-mobile-line { display: flex; align-items: center; min-width: 0; gap: 6px; overflow: hidden; white-space: nowrap; }
  .tx-mobile-kind { display: inline-flex; align-items: center; flex-shrink: 0; gap: 5px; }
  .tx-mobile-kind small { font-size: 9px; color: var(--ink-muted); }
  .tx-mobile-kind .badge { font-size: 9px; padding: 2px 4px; }
  .tx-mobile-money { display: flex; justify-content: flex-end; align-items: center; flex: 1; min-width: 0; gap: 4px; font: 600 11px var(--font-mono); }
  .tx-mobile-money .tx-brief-money { flex: 0 1 auto; }
  .tx-mobile-money .asset-symbol { font-size: 9px; color: var(--ink-muted); }
  .tx-mobile-meta { color: var(--ink-muted); font-size: 9.5px; gap: 5px; }
  .tx-mobile-actor { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .tx-mobile-actor .address-chip { display: inline-flex; max-width: 100%; }
  .tx-mobile-actor .address-main { min-height: 24px; }
  .tx-mobile-actor .address-label { max-width: 100%; font-size: 10px; }
  .tx-mobile-actor .address-tail { font-size: 9px; }
  .tx-mobile-actor .entity-actions { display: none; }
  .tx-mobile-meta time { flex-shrink: 0; font: 9px var(--font-mono); }
  .tx-mobile-hash { flex: 0 1 auto; min-width: 0; max-width: 40%; }
  .tx-mobile-hash .tx-chip { display: inline-flex; flex-direction: row; align-items: center; min-width: 0; gap: 1px; }
  .tx-mobile-hash .tx-link { font-size: 9.5px; }
  .tx-mobile-hash .entity-actions { flex-shrink: 0; height: 24px; }
  .tx-mobile-hash [data-search] { display: none; }
  .tx-mobile-meta .icon-btn { flex-shrink: 0; min-height: 24px; height: 24px; width: 24px; padding: 3px; }
}

/* PNIX 交易摘要：桌面每格至多两行，手机固定两行；完整证据放入交易详情。 */
.pnix-table .pnix-tx-row > td {
  height: 48px;
  padding-top: 4px;
  padding-bottom: 4px;
  white-space: nowrap;
}

.pnix-table .pnix-tx-line {
  display: block;
  max-width: 100%;
  height: 17px;
  line-height: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnix-table .pnix-tx-row .sub {
  display: block;
  height: 15px;
  margin: 0;
  line-height: 15px;
  white-space: nowrap;
}

.pnix-table .pnix-tx-row .address-chip {
  height: 24px;
  vertical-align: top;
}

.pnix-table .pnix-tx-row .money {
  vertical-align: top;
  line-height: 17px;
}

.pnix-summary-role {
  color: var(--ink-muted);
  font-size: 9.5px;
  font-weight: 400;
}

/* 明细折叠保持一笔撮合一项，预算、成交、费用和退款分别阅读。 */
.pnix-transaction-events {
  display: grid;
  gap: 7px;
}

.pnix-transaction-event {
  border: 1px solid var(--line-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.pnix-transaction-event > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink-secondary);
  background: var(--surface-subtle, #f6f8f8);
  cursor: pointer;
  font-size: 11px;
  list-style: none;
}

.pnix-transaction-event > summary::before {
  content: '›';
  flex: 0 0 9px;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-muted);
}

.pnix-transaction-event[open] > summary::before {
  transform: rotate(90deg);
}

.pnix-transaction-event > summary::-webkit-details-marker {
  display: none;
}

.pnix-transaction-event > summary > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pnix-transaction-event > summary > span:first-of-type {
  flex: 1;
}

.pnix-transaction-event > summary > span:last-child {
  max-width: 50%;
  text-align: right;
}

.pnix-transaction-event > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.pnix-transaction-event-body {
  padding: 0 12px 2px;
}

.pnix-transaction-event-body .pnix-boundary {
  margin-bottom: 10px;
}

@media (max-width: 767px) {
  .pnix-mobile-row.pnix-tx-mobile {
    grid-template-rows: 22px 24px;
    gap: 0;
    padding: 4px 7px 4px 8px;
  }

  .pnix-tx-mobile-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 7px;
    overflow: hidden;
    white-space: nowrap;
  }

  .pnix-tx-mobile-title,
  .pnix-tx-mobile-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 20px;
    white-space: nowrap;
  }

  .pnix-tx-mobile-title {
    flex: 1 1 42%;
    font-size: 10px;
    color: var(--ink-muted);
  }

  .pnix-tx-mobile-title strong {
    font-size: 11px;
    color: var(--ink-secondary);
  }

  .pnix-tx-mobile-value {
    flex: 0 1 58%;
    text-align: right;
  }

  .pnix-tx-mobile-value .money {
    display: inline;
    font-size: 11.5px;
    white-space: nowrap;
  }

  .pnix-tx-mobile-context {
    color: var(--ink-muted);
    font-size: 9.5px;
  }

  .pnix-tx-mobile-context-left,
  .pnix-tx-mobile-context-right {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 24px;
    gap: 5px;
  }

  .pnix-tx-mobile-context-left {
    flex: 1 1 auto;
    overflow: hidden;
  }

  .pnix-tx-mobile-context-left time,
  .pnix-tx-mobile-count {
    flex-shrink: 0;
  }

  .pnix-tx-mobile-context-left .address-chip {
    display: inline-flex;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 140px;
    height: 24px;
  }

  .pnix-tx-mobile-context-left .address-main {
    min-width: 0;
    min-height: 24px;
    height: 24px;
  }

  .pnix-tx-mobile-context-left .address-label {
    font-size: 10px;
  }

  .pnix-tx-mobile-context-right {
    flex: 0 1 auto;
    max-width: 45%;
    gap: 1px;
  }

  .pnix-tx-mobile-context-right .tx-chip {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    gap: 1px;
  }

  .pnix-tx-mobile-context-right .tx-link {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9.5px;
  }

  .pnix-tx-mobile-context-right .entity-actions {
    flex-shrink: 0;
    height: 24px;
  }

  .pnix-tx-mobile-context-right [data-search] {
    display: none;
  }

  .pnix-tx-mobile-context-right .icon-btn {
    flex-shrink: 0;
    min-height: 24px;
    height: 24px;
    width: 24px;
    padding: 3px;
  }
}

/* 特殊业务按Hash摘要；资产角色不相加，桌面每格最多两行。 */
.sp-table .sp-tx-row > td {
  height: 48px;
  white-space: nowrap;
}

.sp-table .sp-tx-row .sub {
  display: block;
  height: 15px;
  margin: 0;
  line-height: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-tx-amount {
  display: block;
  min-width: 0;
  height: 18px;
  line-height: 18px;
  overflow: hidden;
}

.sp-tx-amount .tx-brief-money {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.sp-tx-amount .tx-brief-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font: 600 11.5px/18px var(--font-mono);
}

.sp-tx-amount .asset-symbol {
  flex-shrink: 0;
  font-size: 10px;
}

.sp-transaction-events {
  display: grid;
  gap: 8px;
}

.sp-selected-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
}

.sp-transaction-event {
  min-width: 0;
  border: 1px solid var(--line-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.sp-transaction-event > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--surface-subtle, #f6f8f8);
  cursor: pointer;
  list-style: none;
}

.sp-transaction-event > summary::before {
  content: '›';
  flex: 0 0 9px;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-muted);
}

.sp-transaction-event[open] > summary::before {
  transform: rotate(90deg);
}

.sp-transaction-event > summary::-webkit-details-marker {
  display: none;
}

.sp-transaction-event > summary > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sp-transaction-event > summary > span:first-of-type {
  flex: 1;
}

.sp-transaction-event > summary strong {
  display: block;
  color: var(--ink-secondary);
  font-size: 12px;
}

.sp-transaction-event > summary small {
  display: block;
  color: var(--ink-muted);
  font-size: 10px;
}

.sp-transaction-event > summary > span:last-child {
  max-width: 50%;
}

.sp-transaction-event > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.sp-transaction-event-body {
  padding: 10px 12px 12px;
}

.sp-transaction-event-body .sp-hero {
  margin: 0;
}

.sp-transaction-event-body .sp-lifecycle {
  margin-top: 14px;
}

@media (max-width: 767px) {
  #special .sp-mobile-row.sp-tx-mobile {
    display: grid;
    grid-template-rows: 22px 24px;
    gap: 0;
    min-height: 0;
    padding: 4px 7px 4px 8px;
  }

  .sp-tx-mobile-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
  }

  .sp-tx-mobile-type,
  .sp-tx-mobile-amount {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
  }

  .sp-tx-mobile-type {
    flex: 1 1 46%;
  }

  .sp-tx-mobile-type .badge {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .sp-tx-mobile-type small,
  .sp-tx-mobile-amount > small {
    flex-shrink: 0;
    color: var(--ink-muted);
    font-size: 9px;
  }

  .sp-tx-mobile-amount {
    flex: 0 1 54%;
    justify-content: flex-end;
  }

  .sp-tx-mobile-amount .tx-brief-money {
    display: inline-flex;
    align-items: baseline;
    min-width: 0;
    gap: 3px;
    overflow: hidden;
  }

  .sp-tx-mobile-amount .tx-brief-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 600 11.5px/18px var(--font-mono);
  }

  .sp-tx-mobile-amount .asset-symbol {
    flex-shrink: 0;
    font-size: 10px;
  }

  .sp-tx-mobile-meta {
    color: var(--ink-muted);
    font-size: 9.5px;
  }

  .sp-tx-mobile-actor {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .sp-tx-mobile-meta time {
    flex-shrink: 0;
  }

  .sp-tx-mobile-actor .address-chip {
    display: inline-flex;
    flex-direction: row;
    height: 24px;
    min-width: 0;
    max-width: 100%;
  }

  .sp-tx-mobile-actor .address-main {
    min-width: 0;
    height: 24px;
    min-height: 24px;
  }

  .sp-tx-mobile-actor .address-label {
    font-size: 10px;
  }

  .sp-tx-mobile-actor .entity-actions {
    display: none;
  }

  .sp-tx-mobile-hash {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 36%;
  }

  .sp-tx-mobile-hash .tx-chip {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    gap: 1px;
  }

  .sp-tx-mobile-hash .tx-link {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9.5px;
  }

  .sp-tx-mobile-hash .entity-actions {
    flex-shrink: 0;
    height: 24px;
  }

  .sp-tx-mobile-hash [data-search] {
    display: none;
  }

  .sp-tx-mobile-meta .icon-btn {
    flex-shrink: 0;
    min-height: 24px;
    height: 24px;
    width: 24px;
    padding: 3px;
  }
}

/* 规则内的提醒方式：默认值直接可用，手机上按单列阅读。 */
.bark-options {
  min-width: 0;
  margin: 16px 0 8px;
  padding: 10px 12px 11px;
  border: 1px solid var(--line-default);
  border-radius: 7px;
  background: var(--surface-subtle, #f8fafc);
}
.bark-options legend { padding: 0 5px; color: var(--ink-secondary); font-size: 12px; font-weight: 600; }
.bark-options legend .muted { margin-left: 8px; font-size: 10px; font-weight: 400; }
.bark-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; align-items: start; }
.bark-options .field { min-width: 0; margin: 0; }
.bark-options select, .bark-options input[type="text"] { width: 100%; min-width: 0; }
.bark-options .bark-volume-field { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; }
.bark-volume-field output { color: var(--ink-secondary); font: 11px var(--font-mono); }
.bark-volume-field input[type="range"] { grid-column: 1 / -1; width: 100%; min-height: 26px; padding: 0; accent-color: var(--brand); }
.bark-volume-field:has(input:disabled) { opacity: .6; }
.bark-call-option { display: flex; align-items: center; min-height: 38px; gap: 7px; font-size: 11px; color: var(--ink-secondary); }
.bark-call-option input { width: 15px; min-height: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.bark-call-option:has(input:disabled) { opacity: .6; }
.bark-options-help { margin: 9px 0 0; color: var(--ink-secondary); font-size: 10.5px; line-height: 1.65; }
.bark-options-footnote { margin: 4px 0 0; color: var(--ink-muted); font-size: 10px; line-height: 1.6; }
.bark-options:disabled { opacity: .65; }
@media (max-width: 767px) {
  .bark-options { padding: 8px 10px 10px; }
  .bark-options-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .bark-options legend { display: block; max-width: 100%; }
  .bark-options legend .muted { margin-left: 5px; font-size: 9.5px; }
  .bark-options .bark-volume-field { gap: 6px; }
  .bark-volume-field input[type="range"] { min-height: 32px; }
  .bark-call-option { min-height: 32px; }
}
/* 独立质押工作区：紧凑表格、安静状态色和手机抽屉。 */
.stk-summary-line{display:flex;align-items:center;gap:22px;flex-wrap:wrap;padding:4px 0 18px;border-bottom:1px solid var(--border,#e2e8f0);font-size:12px}.stk-summary-line strong{margin-left:6px;font-weight:650}.stk-summary-line small{font-size:10px;font-weight:400}.stk-tabs{margin:18px 0 14px;max-width:100%;overflow:auto;white-space:nowrap}.stk-tabs button{flex-shrink:0}.stk-filters{gap:9px}.stk-filters .search-input{min-width:220px;max-width:360px;flex:1}.stk-filters input,.stk-filters select{min-height:34px}.stk-amount-filter input{width:130px}.stk-context{font-size:11px;margin:0 0 12px;line-height:1.7}.stk-table{table-layout:fixed;width:100%}.stk-table th{font-weight:500;font-size:11px}.stk-table td{padding:10px 12px;height:62px;vertical-align:middle}.stk-cell{min-width:0;overflow:hidden;font-size:12px;line-height:21px}.stk-cell>div,.stk-cell>small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.stk-cell small{font-size:10px;line-height:17px}.stk-cell small small{display:inline}.stk-row-actions{width:80px;text-align:right}.stk-state{font-size:11px;color:#64748b}.stk-state.ready{color:#047857}.stk-state.soon{color:#a16207}.stk-row.ready{background:#f0faf5}.stk-row.soon{background:#fffaf0}.stk-coverage{font-size:11px;line-height:1.8;color:#64748b;margin-top:20px;max-width:1050px}.stk-coverage summary{cursor:pointer}.stk-mobile{display:none}.stk-detail{width:min(620px,100vw)}.stk-facts{display:grid;grid-template-columns:130px 1fr;gap:16px 12px;font-size:12px;margin:24px 0}.stk-facts dt{color:#64748b}.stk-facts dd{margin:0;overflow-wrap:anywhere}.stk-detail-section{border-top:1px solid #e2e8f0;padding-top:14px;margin-top:20px}.stk-detail-section h3{font-size:13px;margin:0 0 10px}.stk-detail-section li{font-size:12px;line-height:1.8;margin-bottom:10px}.stk-review-banner{font-size:12px;line-height:1.8;background:#f0f7f4;color:#376552;padding:12px;border-radius:6px}.stk-detail .drawer-body>p{font-size:12px;line-height:1.9}.stk-detail .drawer-body>h3{font-size:14px;margin-top:28px}
@media(max-width:767px){.stk-summary-line{gap:12px 18px;padding-bottom:14px}.stk-summary-line>span:last-child{width:100%;font-size:10px}.stk-tabs{display:flex;width:100%;gap:2px}.stk-tabs button{font-size:11px;padding:8px 10px}.stk-filters{display:flex;flex-wrap:wrap}.stk-filters .search-input{flex-basis:100%;max-width:none;min-width:0}.stk-filters>label{min-width:0}.stk-filters select{max-width:100%;font-size:11px}.stk-amount-filter{flex:1}.stk-amount-filter input{width:100%;min-width:0}.stk-filters>span.stk-amount-filter{flex:0}.stk-filters input{font-size:12px}.stk-table{display:none}#staking-table{display:none}.stk-mobile{display:block}.stk-mobile-row{padding:10px 0;border-bottom:1px solid #e8edf3;min-height:74px}.stk-mobile-row>div{display:flex;gap:10px;align-items:center;justify-content:space-between;min-width:0}.stk-mobile-row>div>.stk-cell{flex:1;min-width:0}.stk-mobile-row>div:nth-child(2){margin-top:6px}.stk-mobile-row .stk-cell{font-size:11px}.stk-mobile-row .stk-cell small{font-size:9px}.stk-mobile-row>div:nth-child(2)>.stk-cell:nth-child(n+3){display:none}.stk-mobile-row.ready{background:#f0faf5}.stk-mobile-row.soon{background:#fffaf0}.stk-mobile-row .btn{font-size:10px;padding:4px 6px;min-height:30px}.stk-detail{width:100vw;max-width:100vw}.stk-facts{grid-template-columns:90px 1fr;gap:14px 8px}.stk-context{font-size:10px}.stk-coverage{font-size:10px}}
@media(max-width:767px){.stk-mobile-row{height:64px;min-height:64px;padding:8px 2px}.stk-mobile-line{height:24px;display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;min-width:0}.stk-mobile-line+.stk-mobile-line{margin-top:0!important}.stk-mobile-line .address-chip{min-width:0;overflow:hidden;flex:1}.stk-mobile-line .address-chip .address-link{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stk-mobile-line>strong{font-size:11px;flex-shrink:0}.stk-mobile-line>small{font-size:9px;color:#64748b}.stk-mobile-line>.btn{margin-left:auto;flex-shrink:0;min-height:22px;padding:1px 4px}.stk-mobile-title{font-size:11px;min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stk-mobile-line .stk-state{font-size:10px}}
.stk-cell .address-chip,.stk-cell .tx-chip{display:inline-flex;flex-direction:row;flex-wrap:nowrap;align-items:center;width:auto;max-width:100%;height:21px;vertical-align:middle}.stk-cell .address-main,.stk-cell .tx-main{display:inline-flex;min-width:0;overflow:hidden}.stk-cell .address-label{max-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stk-cell .entity-actions{display:inline-flex;flex-shrink:0;gap:0}.stk-cell .entity-actions .icon-btn{width:19px;height:20px;min-width:19px;min-height:20px;padding:2px}.stk-cell .entity-actions .icon{width:11px;height:11px}.stk-table td{height:62px;box-sizing:border-box}.stk-mobile-line .address-main{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stk-mobile-line .address-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stk-mobile-line .entity-actions{display:none}
@media(max-width:767px){.stk-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}.stk-filters .search-input{grid-column:1/-1;min-width:0;max-width:none}.stk-filters>label{min-width:0;display:block}.stk-filters>label:has(#staking-kind){grid-column:1/-1}.stk-filters>span.stk-amount-filter{display:none}.stk-filters input,.stk-filters select{width:100%;box-sizing:border-box;min-width:0}.stk-filters>.btn{justify-content:center}}
.stk-accounting{margin:0 0 16px;padding:10px 12px;background:#fffaf0;color:#815b23;border:1px solid #f1e4c7;border-radius:6px;font-size:11px;line-height:1.7}.stk-accounting summary{cursor:pointer;font-weight:550}.stk-accounting p{max-width:900px;margin:10px 0}.stk-accounting table{width:100%;table-layout:fixed;font-size:11px;border-collapse:collapse}.stk-accounting th,.stk-accounting td{padding:7px 8px;text-align:left;word-break:break-word;border-bottom:1px solid #eee5d5}.stk-accounting small{font-size:9px}
