:root {
  --bg: #080c0d;
  --panel: #101719;
  --panel-2: #141d1f;
  --line: #263336;
  --text: #f2f6f3;
  --muted: #9fb0aa;
  --green: #1ed885;
  --green-2: #0ea96b;
  --cyan: #4ed8ff;
  --gold: #f4bf4a;
  --red: #ff5c6c;
  --white: #ffffff;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: radial-gradient(circle at 80% 0%, rgba(30, 216, 133, 0.13), transparent 30%),
    linear-gradient(180deg, #07100f 0%, var(--bg) 44%, #070909 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 13, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 170px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(30, 216, 133, 0.7);
  border-radius: 8px;
  color: var(--green);
  background: rgba(30, 216, 133, 0.12);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.top-nav {
  display: inline-flex;
  justify-content: center;
  gap: 6px;
}

.nav-btn,
.segmented button {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}

.nav-btn {
  padding: 9px 13px;
}

.nav-btn.active,
.segmented button.active {
  color: var(--text);
  border-color: rgba(30, 216, 133, 0.35);
  background: rgba(30, 216, 133, 0.12);
}

.login-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.login-form input {
  width: 132px;
}

.login-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  max-width: 170px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid rgba(30, 216, 133, 0.28);
  border-radius: 8px;
  color: var(--green);
  background: rgba(30, 216, 133, 0.1);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-btn,
.icon-btn {
  border: 0;
  border-radius: 8px;
  color: #06100c;
  background: var(--green);
  font-weight: 800;
}

.primary-btn {
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(30, 216, 133, 0.18);
}

.primary-btn:hover {
  background: #43e79d;
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.wide {
  width: 100%;
}

.hero {
  position: relative;
  min-height: clamp(330px, 46vh, 520px);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(5, 8, 9, 0.94) 0%, rgba(5, 8, 9, 0.68) 38%, rgba(5, 8, 9, 0.16) 74%),
    linear-gradient(0deg, rgba(8, 12, 13, 0.92) 0%, transparent 34%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
  min-height: clamp(330px, 46vh, 520px);
  padding: 42px clamp(18px, 4vw, 54px);
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  max-width: 680px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.96;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 14px;
  font-size: 16px;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-metrics span {
  display: grid;
  min-width: 138px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(10, 16, 17, 0.72);
}

.hero-metrics b {
  font-size: 23px;
}

.hero-metrics small {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  padding: 18px clamp(14px, 3vw, 34px) 40px;
}

.side-panel,
.bet-slip,
.admin-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(16, 23, 25, 0.9);
  box-shadow: var(--shadow);
}

.side-panel,
.bet-slip {
  position: sticky;
  top: 82px;
  padding: 15px;
}

.panel-head,
.section-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.panel-head {
  margin-bottom: 14px;
}

.icon-btn {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: rgba(30, 216, 133, 0.13);
  color: var(--green);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.field-label {
  display: block;
  margin: 12px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.full-input,
.select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #0a1011;
  outline: none;
  padding: 10px 12px;
}

.full-input:focus,
.select:focus {
  border-color: rgba(78, 216, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(78, 216, 255, 0.12);
}

.segmented {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.segmented button {
  display: flex;
  justify-content: space-between;
  min-height: 38px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.03);
}

.notice {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(244, 191, 74, 0.22);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(244, 191, 74, 0.08);
  font-size: 12px;
}

.notice span {
  color: #d6c48d;
}

.content-view {
  display: none;
  min-width: 0;
}

.content-view.active {
  display: block;
}

.section-head {
  min-height: 56px;
  margin-bottom: 14px;
}

.market-type-tabs {
  display: flex;
  gap: 8px;
  max-width: 100%;
  margin: -4px 0 14px;
  padding-bottom: 4px;
  overflow-x: auto;
}

.market-type-tabs button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  white-space: nowrap;
  font-weight: 800;
}

.market-type-tabs button.active {
  color: var(--text);
  border-color: rgba(30, 216, 133, 0.42);
  background: rgba(30, 216, 133, 0.12);
}

.market-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.market-card {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 29, 31, 0.96), rgba(11, 16, 17, 0.96));
}

.closed-market {
  border-color: rgba(255, 255, 255, 0.055);
  opacity: 0.58;
  filter: grayscale(0.45);
}

.market-row {
  grid-template-columns: minmax(180px, 0.95fr) minmax(280px, 2fr) minmax(150px, auto);
  align-items: center;
}

.market-main {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.market-title {
  min-width: 0;
}

.market-title h3 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.22;
}

.market-title small,
.market-meta,
.empty-state {
  color: var(--muted);
}

.market-badge {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(78, 216, 255, 0.28);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(78, 216, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.outcome-list {
  display: grid;
  gap: 8px;
}

.odds-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.outcome-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
}

.odds-strip .outcome-btn {
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  width: clamp(118px, 15vw, 172px);
  min-height: 62px;
  padding: 8px 9px;
}

.outcome-btn:hover,
.outcome-btn.selected {
  border-color: rgba(30, 216, 133, 0.55);
  background: rgba(30, 216, 133, 0.11);
}

.outcome-btn:disabled {
  cursor: not-allowed;
  color: rgba(242, 246, 243, 0.5);
  background: rgba(255, 255, 255, 0.025);
}

.outcome-btn:disabled .team-code {
  color: rgba(6, 16, 12, 0.58);
  background: rgba(244, 191, 74, 0.46);
}

.outcome-label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.team-code {
  display: inline-grid;
  min-width: 36px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  color: #06100c;
  background: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.outcome-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price {
  display: grid;
  justify-items: end;
  font-weight: 900;
}

.odds-strip .price {
  grid-auto-flow: column;
  justify-content: space-between;
  align-items: end;
}

.price small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.pool-bars {
  display: grid;
  gap: 7px;
}

.pool-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #253033;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.market-meta {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.market-row .market-meta {
  display: grid;
  justify-items: end;
  min-width: 145px;
}

.status-open {
  color: var(--green);
}

.status-resolved {
  color: var(--gold);
}

.status-voided {
  color: var(--red);
}

.status-closed {
  color: var(--muted);
}

.bet-slip {
  display: grid;
  gap: 14px;
}

.status-dot {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.status-dot.online {
  color: var(--green);
  background: rgba(30, 216, 133, 0.12);
}

.bet-form {
  display: grid;
  gap: 8px;
}

.profile-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(78, 216, 255, 0.18);
  border-radius: 8px;
  background: rgba(78, 216, 255, 0.055);
}

.profile-box small {
  color: var(--muted);
}

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

.hidden {
  display: none;
}

.quote-box,
.wallet-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid rgba(30, 216, 133, 0.24);
  border-radius: 8px;
  background: rgba(30, 216, 133, 0.09);
}

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

.quote-box b,
.wallet-chip {
  color: var(--green);
}

.mini-ledger {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.ledger-row,
.data-row {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ledger-row small,
.data-row small {
  color: var(--muted);
}

.data-list {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(16, 23, 25, 0.78);
  padding: 4px 16px;
}

.data-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 62px;
}

.data-row strong,
.data-row span {
  overflow-wrap: anywhere;
}

.data-row strong small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.admin-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-panel {
  padding: 15px;
}

.admin-layout > .admin-panel:last-child {
  grid-column: 1 / -1;
}

#create-market-form {
  grid-column: 1 / -1;
}

.admin-panel form,
.admin-panel {
  min-width: 0;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(170px, 220px) auto;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.toggle-line {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #0a1011;
  white-space: nowrap;
}

.resolve-list {
  display: grid;
  gap: 10px;
  max-height: 680px;
  overflow: auto;
}

.account-output {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-output small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.account-output pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: #070b0c;
  font-size: 12px;
  line-height: 1.55;
}

.report-list {
  display: grid;
  gap: 7px;
}

.report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.report-row strong,
.report-row small {
  display: block;
}

.report-status {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.report-status.ok {
  color: var(--green);
  background: rgba(30, 216, 133, 0.12);
}

.report-status.warn {
  color: var(--gold);
  background: rgba(244, 191, 74, 0.1);
}

.report-status.bad {
  color: var(--red);
  background: rgba(255, 92, 108, 0.1);
}

.resolve-item {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.resolve-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.resolve-preview span {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 8px;
  border: 1px solid rgba(78, 216, 255, 0.16);
  border-radius: 8px;
  background: rgba(78, 216, 255, 0.055);
}

.resolve-preview small {
  color: var(--muted);
}

.resolve-preview strong {
  overflow-wrap: anywhere;
}

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

.danger-btn,
.ghost-btn {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 800;
}

.compact {
  min-height: 40px;
  padding: 0 12px;
}

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
}

.danger-btn {
  border: 1px solid rgba(255, 92, 108, 0.4);
  color: var(--red);
  background: rgba(255, 92, 108, 0.08);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(10, 16, 17, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.18s ease;
  pointer-events: none;
}

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

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .market-row {
    grid-template-columns: 1fr;
  }

  .market-row .market-meta {
    display: flex;
    justify-items: start;
    min-width: 0;
  }

  .bet-slip {
    position: static;
    grid-column: 1 / -1;
    order: 3;
  }
}

@media (max-width: 880px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .top-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .login-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
  }

  .login-form input {
    width: 100%;
  }

  .workspace,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-toolbar,
  .resolve-preview {
    grid-template-columns: 1fr 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .nav-btn {
    padding: 8px 10px;
  }

  .hero-content {
    padding-inline: 16px;
  }

  h1 {
    font-size: 40px;
  }

  .hero-metrics span {
    min-width: calc(50% - 5px);
  }

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

  .nickname-form,
  .account-actions {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding-inline: 10px;
  }

  .market-type-tabs {
    margin-inline: -2px;
  }

  .odds-strip .outcome-btn {
    width: calc(50% - 4px);
    min-width: 0;
  }

  .admin-toolbar,
  .resolve-preview,
  .resolve-actions {
    grid-template-columns: 1fr;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }
}

/* 玩法介绍 */
.guide-notice {
  margin-top: 4px;
}

.guide-section {
  margin-top: 26px;
}

.guide-section > h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--green);
}

.guide-section > h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--green);
  vertical-align: -2px;
}

.guide-lead,
.guide-example {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}

.guide-lead b,
.guide-example b {
  color: var(--text);
}

.guide-steps,
.guide-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-steps b,
.guide-list b {
  color: var(--text);
}

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

.guide-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.guide-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text);
}

.guide-tag {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
}

.guide-card p:last-child {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.guide-card p b {
  color: var(--text);
}

.guide-formula {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid rgba(30, 216, 133, 0.25);
  border-radius: 8px;
  background: rgba(30, 216, 133, 0.06);
}

.guide-formula-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.guide-formula-line span {
  font-weight: 700;
  color: var(--text);
}

.guide-formula-line code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--green);
}

.guide-example {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 6px 6px 0;
}
