:root {
  --bg: #050816;
  --bg-soft: #0b1220;
  --bg-softer: #020617;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.18);
  --accent-strong: #4ade80;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #fb7185;
  --card-radius: 18px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.85);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 46%, #000 100%);
  color: var(--text-main);
  min-height: 100vh;
  padding: 16px;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
}

/* 顶部导航 */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 60%),
    rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.85);
  position: sticky;
  top: 10px;
  z-index: 20;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;              /* 不允许被压扁 */
  border-radius: 50%;          /* 强制变成圆形 */
  background: conic-gradient(from 210deg, #22c55e, #38bdf8, #a855f7, #22c55e);
  padding: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 如果还保留 logo-inner，就这样写成圆形 */
.logo-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 20% 0, rgba(248, 250, 252, 0.98), #020617);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #020617;
}

/* 对现在用的图片也强制圆形且不变形 */
.logo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover; /* 填满圆形，不拉伸，必要时裁掉一点边缘 */
}


.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #bbf7d0, #22c55e);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.7), 0 0 12px rgba(74, 222, 128, 0.8);
}

.btn {
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease-out;
  white-space: nowrap;
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 1);
  color: #e5e7eb;
}

.btn-primary {
  background: radial-gradient(circle at 0 0, #4ade80, #22c55e);
  color: #020617;
  border: 1px solid rgba(34, 197, 94, 0.9);
  box-shadow: 0 13px 32px rgba(34, 197, 94, 0.4);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-0.5px);
  box-shadow: 0 16px 40px rgba(22, 163, 74, 0.55);
}

.btn-icon {
  font-size: 15px;
}

.btn-ghost--small {
  padding: 5px 9px;
  font-size: 11px;
}

.btn-ghost--tiny {
  font-size: 11px;
  padding: 5px 9px;
}

/* 主体布局 */
.main {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .main {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 左侧：Hero + 市场列表 */
.hero {
  padding: 18px 18px 16px;
  border-radius: var(--card-radius);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(251, 113, 133, 0.22), transparent 55%),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.93), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 20% 0, rgba(52, 211, 153, 0.14), transparent 60%),
    radial-gradient(circle at 80% 0, rgba(59, 130, 246, 0.22), transparent 60%);
  opacity: 0.8;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr);
  gap: 12px;
  align-items: center;
}

@media (max-width: 720px) {
  .hero-content {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero-title {
  font-size: clamp(22px, 3vw, 26px);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.hero-highlight {
  background: linear-gradient(to right, #f97316, #22c55e, #38bdf8);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.hero-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 4px 9px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.95);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  font-size: 11px;
}

.stat {
  padding: 8px 9px;
  border-radius: 14px;
  border: 1px solid rgba(30, 64, 175, 0.9);
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.22), transparent 60%);
}

.stat-label {
  color: #9ca3af;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 13px;
  font-weight: 600;
}

.stat-trend {
  font-size: 11px;
  margin-top: 2px;
  color: #4ade80;
}

.stat-trend.neg {
  color: #fb7185;
}

.hero-mini-chart {
  width: 100%;
  height: 110px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 20% 0, rgba(74, 222, 128, 0.25), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(56, 189, 248, 0.22), transparent 55%),
    #020617;
  border: 1px solid rgba(30, 64, 175, 0.85);
  position: relative;
  overflow: hidden;
}

.mini-chart-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(15, 23, 42, 0.8) 1px, transparent 1px),
    linear-gradient(to top, rgba(15, 23, 42, 0.8) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.4;
}

.mini-chart-line {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 70%, rgba(74, 222, 128, 0.4), transparent 60%),
    radial-gradient(circle at 60% 20%, rgba(56, 189, 248, 0.5), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.mini-chart-label {
  position: absolute;
  bottom: 7px;
  left: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.mini-chart-chip {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
}

/* 市场区块 */
.panel {
  padding: 14px;
  border-radius: var(--card-radius);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(51, 65, 85, 0.9);
  box-shadow: var(--shadow-soft);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.panel-header--small {
  margin-top: -4px;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title--muted {
  font-size: 12px;
  color: var(--text-muted);
}

.panel-title-badge {
  font-size: 11px;
  color: var(--text-muted);
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.98);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tab {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: rgba(15, 23, 42, 0.98);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.16s ease-out;
}

.tab.active {
  border-color: rgba(34, 197, 94, 0.9);
  background: var(--accent-soft);
  color: #bbf7d0;
}

.tab.secondary.active {
  border-color: rgba(59, 130, 246, 0.9);
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}

.markets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.market-card {
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: radial-gradient(circle at 0 0, rgba(15, 118, 110, 0.16), transparent 55%),
    rgba(15, 23, 42, 0.98);
  padding: 10px 11px;
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.3fr);
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.16s ease-out, transform 0.1s ease-out,
    box-shadow 0.16s ease-out, background 0.18s ease-out;
}

.market-card:hover {
  border-color: rgba(34, 197, 94, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.18), transparent 55%),
    rgba(15, 23, 42, 0.98);
}

@media (max-width: 640px) {
  .market-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

.market-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.market-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}

.market-chip {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.98);
}

.market-chip.live {
  border-color: rgba(34, 197, 94, 0.9);
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.15);
}

.market-chip.soon {
  border-color: rgba(234, 179, 8, 0.9);
  color: #facc15;
  background: rgba(234, 179, 8, 0.12);
}

.market-question {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.market-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.market-extra span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.9);
}

.market-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  align-items: center;
}

.side-label {
  font-size: 11px;
  color: var(--text-muted);
}

.side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.side-odds {
  font-size: 14px;
  font-weight: 600;
}

.side-btn {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.96);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.16s ease-out;
}

.side-btn.primary {
  border-color: rgba(34, 197, 94, 0.9);
  background: var(--accent-soft);
  color: #bbf7d0;
}

.side-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-0.3px);
}

.market-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}

.market-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.liquidity-pill {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: rgba(15, 23, 42, 0.98);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.danger-text {
  color: var(--danger);
}

/* 右侧：选中市场详情 */
.detail {
  padding: 14px 14px 12px;
  border-radius: var(--card-radius);
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.18), transparent 60%),
    rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(51, 65, 85, 1);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 96px);
  overflow: auto;
}

@media (max-width: 900px) {
  .detail {
    position: static;
    max-height: none;
  }
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.detail-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.detail-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.98);
}

.badge.live {
  border-color: rgba(34, 197, 94, 0.9);
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.16);
}

.detail-section-title {
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 4px;
}

.detail-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 8px 2px 2px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.detail-pill {
  border-radius: 14px;
  border: 1px solid rgba(55, 65, 81, 0.95);
  background: rgba(15, 23, 42, 0.98);
  padding: 7px 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.detail-pill-label {
  margin-bottom: 3px;
}

.detail-pill-value {
  font-size: 13px;
  font-weight: 500;
  color: #e5e7eb;
}

.detail-sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.detail-side-card {
  border-radius: 14px;
  border: 1px solid rgba(55, 65, 81, 0.95);
  background: rgba(15, 23, 42, 0.98);
  padding: 7px 8px;
  font-size: 11px;
}

.detail-side-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.detail-side-odds {
  font-size: 15px;
  font-weight: 600;
}

.detail-side-extra {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.detail-input-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-input-row input {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.95);
  background: rgba(15, 23, 42, 0.98);
  padding: 7px 9px;
  color: #e5e7eb;
  font-size: 12px;
  outline: none;
}

.detail-input-row input:focus {
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
}

.detail-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}

.detail-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill-info {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.95);
  background: rgba(15, 23, 42, 0.98);
}

/* detailContent 默认隐藏，用 JS 打开 */
.detail-content {
  display: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.98);
  color: #e5e7eb;
  border-radius: 12px;
  padding: 8px 11px;
  font-size: 12px;
  border: 1px solid rgba(55, 65, 81, 0.95);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.85);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast-badge {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.9);
  background: rgba(22, 163, 74, 0.18);
  color: #bbf7d0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
