/* ============ 主题变量 ============ */
:root {
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root,
[data-theme="dark"] {
  --bg: #070b16;
  --bg-2: #0b1122;
  --bg-3: #101a33;
  --panel: rgba(15, 23, 42, 0.74);
  --panel-solid: #0f172a;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e2e8f0;
  --text-soft: #cbd5e1;
  --muted: #8496ae;
  --primary: #22d3ee;
  --primary-2: #4f7cff;
  --primary-soft: rgba(34, 211, 238, 0.12);
  --gold: #f5c04e;
  --gold-soft: rgba(245, 192, 78, 0.12);
  --buy: #10b981;
  --buy-soft: rgba(16, 185, 129, 0.12);
  --sell: #fb4f72;
  --sell-soft: rgba(251, 79, 114, 0.12);
  --danger: #f43f5e;
  --shadow: 0 18px 48px rgba(2, 6, 23, 0.55);
  --particle-color: rgba(79, 124, 255, 0.32);
  --gradient: linear-gradient(120deg, #22d3ee 0%, #4f7cff 55%, #8b5cf6 100%);
  --gradient-gold: linear-gradient(120deg, #f7d47b 0%, #f5b84e 100%);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eef2f8;
  --bg-2: #e7edf7;
  --bg-3: #dde6f4;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.2);
  --text: #0f172a;
  --text-soft: #1e293b;
  --muted: #64748b;
  --primary: #0891b2;
  --primary-2: #4f46e5;
  --primary-soft: rgba(8, 145, 178, 0.1);
  --gold: #b47a12;
  --gold-soft: rgba(180, 122, 18, 0.1);
  --buy: #059669;
  --buy-soft: rgba(5, 150, 105, 0.1);
  --sell: #e11d48;
  --sell-soft: rgba(225, 29, 72, 0.08);
  --danger: #dc2626;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  --particle-color: rgba(79, 70, 229, 0.16);
  --gradient: linear-gradient(120deg, #0891b2 0%, #4f46e5 55%, #7c3aed 100%);
  --gradient-gold: linear-gradient(120deg, #d99a1b 0%, #b47a12 100%);
  color-scheme: light;
}

/* ============ 基础 ============ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(1000px 520px at 12% -8%, rgba(79, 124, 255, 0.16), transparent 60%),
    radial-gradient(900px 480px at 88% 12%, rgba(34, 211, 238, 0.12), transparent 62%),
    radial-gradient(1100px 600px at 50% 115%, rgba(139, 92, 246, 0.1), transparent 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
}

#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  flex: 1;
}

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

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 5px;
  word-break: break-all;
}

.container {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

/* ============ 顶部导航 ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  color: var(--text);
}

.logo-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(245, 192, 78, 0.35);
}

.logo-sub {
  font-style: normal;
  font-size: 12px;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 6px;
  padding: 1px 7px;
  margin-left: 6px;
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-inline: auto;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--primary-soft);
}

.nav-links a.active {
  color: var(--text);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.25);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-btn {
  display: none;
}

/* ============ 按钮 ============ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
  overflow: hidden;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  color: #04121f;
  background: var(--gradient);
  box-shadow: 0 8px 22px rgba(56, 131, 246, 0.28);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(56, 131, 246, 0.36);
}

.btn-outline {
  color: var(--text-soft);
  background: transparent;
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 13px;
  border-radius: 10px;
}

.danger-text:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-marquee::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.35) 50%, transparent 75%);
  transform: translateX(-120%);
  animation: marquee 3.4s ease-in-out infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(-120%);
  }
  55%,
  100% {
    transform: translateX(120%);
  }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.inline-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.wallet-btn.connected {
  border-color: var(--buy);
}

/* ============ 移动端抽屉 ============ */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--panel-solid);
  border-left: 1px solid var(--border);
  z-index: 80;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-weight: 700;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.drawer-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  color: var(--text-soft);
  font-weight: 500;
}

.drawer-links a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.drawer-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.5);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.drawer-mask.open {
  opacity: 1;
  pointer-events: auto;
}

/* ============ 行情跑马灯 ============ */
.market-ticker {
  border-bottom: 1px solid var(--border);
  background: var(--gold-soft);
}

.ticker-viewport {
  overflow: hidden;
}

.ticker-track {
  display: flex;
  gap: 44px;
  align-items: center;
  width: max-content;
  padding: 9px 20px;
  animation: ticker 32s linear infinite;
  font-size: 13px;
  color: var(--muted);
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-loading {
  animation: none;
}

.ticker-item {
  white-space: nowrap;
}

.ticker-item strong {
  color: var(--gold);
  margin-right: 8px;
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ============ 区块 / Hero ============ */
.section {
  padding: 28px 0;
}

.page-hero {
  padding: 16px 0 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 24px;
  align-items: center;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.hero-grid p {
  color: var(--muted);
  max-width: 56ch;
  font-size: 15px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.page-section {
  padding-top: 6px;
}

.section-header {
  margin-bottom: 14px;
}

.section-header h2 {
  font-size: 26px;
  margin-bottom: 6px;
}

.section-header p {
  color: var(--muted);
  font-size: 14px;
}

/* ============ 面板 ============ */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 24px;
}

.wallet-panel.compact {
  padding: 20px;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.tag.muted {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.tag.ok {
  background: var(--buy-soft);
  color: var(--buy);
}

.tag.status-0 {
  background: var(--primary-soft);
  color: var(--primary);
}

.tag.status-1 {
  background: var(--buy-soft);
  color: var(--buy);
}

.tag.status-2 {
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
}

.tag.warn {
  background: var(--sell-soft);
  color: var(--danger);
}

.wallet-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
}

.wallet-identity span {
  font-size: 12px;
  color: var(--muted);
}

.wallet-identity strong {
  font-size: 15px;
  font-family: var(--mono);
  word-break: break-all;
}

.balance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.balance-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.balance-card span {
  font-size: 12px;
  color: var(--muted);
}

.balance-card strong {
  font-size: 17px;
  font-family: var(--mono);
}

/* ============ 订单工具栏 ============ */
.order-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.filter-group {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.filter-group button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-group button.active {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.25);
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.html-select {
  position: relative;
}

.html-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.html-select-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transition: transform 0.2s;
}

.html-select-trigger[aria-expanded="true"] .html-select-arrow {
  transform: rotate(180deg);
}

.html-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 5px;
  display: none;
  z-index: 20;
}

.html-select-menu.open {
  display: block;
}

.html-select-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.html-select-option:hover,
.html-select-option.active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* ============ 订单列表 ============ */
.market-list,
.publish-order-list,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.market-row,
.publish-row,
.history-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-3);
  transition: border-color 0.2s, transform 0.2s;
  flex-wrap: wrap;
}

.market-row:hover,
.publish-row:hover,
.history-row:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.order-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  flex: none;
}

.order-badge.sell {
  color: var(--sell);
  background: var(--sell-soft);
}

.order-badge.buy {
  color: var(--buy);
  background: var(--buy-soft);
}

.order-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
}

.order-cell strong {
  font-size: 15px;
  font-family: var(--mono);
}

.order-cell strong.mine {
  color: var(--gold);
}

.order-cell span {
  font-size: 11.5px;
  color: var(--muted);
}

.order-cell .price strong {
  color: var(--gold);
  font-size: 16px;
}

.order-cell.time {
  margin-left: auto;
  min-width: 130px;
}

.order-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex: none;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 46px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  font-size: 34px;
  color: var(--primary);
  opacity: 0.6;
}

.empty-state code {
  max-width: 90%;
}

.empty-sub {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 38ch;
}

.loading-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

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

/* ============ 分页 ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

/* ============ 规则卡片 / 统计卡片 ============ */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.rule-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.rule-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.rule-card > span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--primary);
}

.rule-card h3 {
  font-size: 17px;
  margin: 6px 0 4px;
}

.rule-card p {
  font-size: 12.5px;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card span {
  font-size: 13px;
  color: var(--muted);
}

.stat-card strong {
  font-size: clamp(20px, 3vw, 28px);
  font-family: var(--mono);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.publish-order-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.publish-order-meta strong {
  font-family: var(--mono);
}

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-mask.open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.97);
  width: min(520px, calc(100vw - 32px));
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 24px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  max-height: 88vh;
  overflow-y: auto;
}

.confirm-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head h3 {
  font-size: 20px;
}

.confirm-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.confirm-quote {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.confirm-quote > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.confirm-quote span {
  color: var(--muted);
}

.confirm-quote strong {
  font-family: var(--mono);
}

.confirm-quote.total {
  border-color: var(--primary);
}

.warn-line {
  font-size: 12px;
  color: var(--danger);
  background: var(--sell-soft);
  border-radius: 8px;
  padding: 8px 10px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
}

/* ============ 表单 ============ */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.field input {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-3);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.quick-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.quick-group .btn {
  flex: 1;
}

.trade-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 18px;
}

.trade-tabs button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
}

.trade-tabs button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.quote-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-3);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 14px 16px;
}

.quote-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.quote-line span {
  color: var(--muted);
}

.quote-line strong {
  font-family: var(--mono);
}

.quote-line .quote-total {
  color: var(--gold);
  font-size: 15px;
}

.quote-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 8px;
}

.quote-warn {
  color: var(--danger);
  background: var(--sell-soft);
  border-radius: 8px;
  margin-top: 4px;
  font-weight: 600;
}

/* ============ Toast ============ */
.toast-wrap {
  position: fixed;
  right: 20px;
  top: 84px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 13px 16px;
  font-size: 13px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left-color: var(--buy);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-warn {
  border-left-color: var(--gold);
}

/* ============ 黑名单横幅 ============ */
.blacklist-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--sell-soft);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: var(--sell);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.network-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--primary);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.network-banner .btn {
  margin-left: auto;
}

.balance-card strong.warn {
  color: var(--danger);
}

/* ============ 页脚 ============ */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  border-top: 1px solid var(--border);
  padding: 16px 0 24px;
  margin-top: 12px;
}

.footer-brand strong {
  font-size: 15px;
}

.footer-slogan {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.footer-contracts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.socials {
  display: flex;
  gap: 10px;
}

/* ============ 动画 ============ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.6s ease forwards;
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.6s ease forwards;
}

.reveal-stagger > *:nth-child(1) {
  animation-delay: 0.05s;
}
.reveal-stagger > *:nth-child(2) {
  animation-delay: 0.12s;
}
.reveal-stagger > *:nth-child(3) {
  animation-delay: 0.19s;
}
.reveal-stagger > *:nth-child(4) {
  animation-delay: 0.26s;
}

.reveal-item {
  animation: reveal 0.4s ease both;
}

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

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .rules-grid,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 6px 0 0;
  }
  .logo {
    order: 0;
  }
  .nav-actions {
    order: 1;
    margin-left: auto;
  }
  .nav-links {
    order: 2;
    display: flex;
    width: 100%;
    gap: 2px;
    margin: 2px 0 0;
    padding: 3px 0 9px;
    border-top: 1px solid var(--border);
    justify-content: space-between;
  }
  .nav-links a {
    flex: 1;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    padding: 6px 4px;
    white-space: nowrap;
  }
  .menu-btn {
    display: none;
  }
  .toast-wrap {
    top: 118px;
  }
  .section {
    padding: 18px 0;
  }
  .page-hero {
    padding: 12px 0 16px;
  }
  .market-row,
  .publish-row,
  .history-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 12px;
  }
  .market-row .order-actions,
  .publish-row .order-actions {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
  }
  .market-row .order-actions .btn,
  .publish-row .order-actions .btn {
    flex: 1;
  }
  .order-cell.time {
    margin-left: 0;
    grid-column: 1 / -1;
  }
  .order-cell {
    min-width: 0;
  }
  .filter-group button {
    padding: 7px 10px;
    font-size: 12px;
  }
  .publish-order-toolbar .publish-order-meta {
    width: 100%;
    flex-wrap: wrap;
  }
  .hero-actions .btn {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .rules-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .balance-grid.compact {
    grid-template-columns: repeat(2, 1fr);
  }
  .logo span {
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .logo-sub {
    display: none;
  }
  .logo-mark {
    width: 30px;
    height: 30px;
  }
  #wallet-action {
    padding: 8px 12px;
    font-size: 13px;
  }
  #wallet-action .inline-icon {
    display: none;
  }
  .balance-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .confirm-modal {
    padding: 18px;
  }
}
