:root {
  color-scheme: light;
  --bg: #e7e4dc;
  --ink: #1c1c1c;
  --muted: #6f6a62;
  --line: #e4e0d8;
  --paper: #fffcf7;
  --up: #d23b32;
  --down: #1d8a57;
  --amber: #8a5a12;
  --amber-bg: #f6edd8;
  --navy: #243044;
  --shadow: 0 16px 40px rgba(36, 32, 24, 0.12);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.7), rgba(255, 252, 247, 0)),
    var(--bg);
  color: var(--ink);
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

.top {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 8px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 13px;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.stage {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 28px;
  align-items: start;
}

.bezel {
  width: 390px;
  height: 800px;
  background: #171513;
  border-radius: 32px;
  padding: 10px;
  box-shadow: var(--shadow);
}

#phone {
  position: relative;
  height: 100%;
  background: var(--paper);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 88px;
  font-weight: 700;
  color: rgba(138, 90, 18, 0.08);
  transform: rotate(-18deg);
  pointer-events: none;
  z-index: 4;
}

.simbar, .nav, .tabbar, .toast, .sheet {
  position: relative;
  z-index: 5;
}

.simbar {
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 12px;
  line-height: 28px;
  text-align: center;
}

.nav {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.nav h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.capsule {
  width: 72px;
  height: 28px;
  border: 1px solid #ddd6cb;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  color: var(--navy);
  font-size: 12px;
}

.capsule span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--navy);
}

.capsule span + span {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--navy);
  background: transparent;
  border-radius: 50%;
}

.screen {
  position: relative;
  flex: 1;
  overflow: auto;
  padding: 12px 12px 16px;
  z-index: 1;
}

.tabbar {
  height: 58px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  background: #fff;
}

.tabbar button {
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
}

.tabbar button.on {
  color: var(--up);
  font-weight: 650;
}

.quote-row, .menu-row, .order, .pos {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 10px 2px;
}

.quote-row, .menu-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.quote-row strong, .px {
  font-variant-numeric: tabular-nums;
  font-size: 20px;
}

.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.45; }
.name { font-weight: 650; }

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}

.hero .px { font-size: 34px; line-height: 1; font-weight: 650; }

.book {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.book button {
  border: 0;
  background: #fff;
  padding: 8px 10px;
  text-align: left;
}

.book button + button { border-left: 1px solid var(--line); }

.seg, .chips, .stepper, .sides, .subtabs {
  display: flex;
  gap: 6px;
}

.seg { margin: 12px 0 8px; }

.seg button, .chips button, .subtabs button, .ghost, .stepper button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
}

.seg button, .subtabs button { flex: 1; height: 32px; }

.seg button.on, .chips button.on, .subtabs button.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.chips { flex-wrap: wrap; margin: 8px 0; }
.chips button { height: 28px; padding: 0 8px; font-size: 12px; }

.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.field input {
  width: 120px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  text-align: right;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.stepper button { width: 36px; height: 36px; }
.stepper strong {
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sides { margin-top: 8px; }
.sides button {
  flex: 1;
  height: 52px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
.sides .buy { background: var(--up); }
.sides .sell { background: var(--down); }
.sides button.soft { opacity: 0.55; }

.reason {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--amber);
  font-size: 12px;
}

.subtabs { margin: 14px 0 6px; }

.order, .pos { display: block; }
.order.on { background: #f6f3ec; }
.rowline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.ops { display: flex; gap: 6px; margin-top: 6px; }
.ops button, .ghost {
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
}

.badge {
  font-size: 12px;
  font-weight: 650;
}
.badge.wait, .badge.pend { color: var(--amber); }
.badge.live, .badge.part { color: var(--navy); }
.badge.done { color: var(--up); }
.badge.dead { color: var(--muted); }
.badge.reject { color: var(--up); }

.chart {
  width: 100%;
  height: 140px;
  display: block;
  margin: 8px 0 12px;
}

.chain {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1.2fr;
  gap: 4px;
  align-items: stretch;
}
.chain button, .chain .k {
  border: 1px solid transparent;
  background: #fff;
  border-radius: 6px;
  min-height: 48px;
  font-size: 12px;
}
.chain button { border-color: var(--line); }
.chain .k {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 650;
}
.chain .itm { background: #fbf6f4; }
.chain .atm { outline: 1px solid var(--navy); }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}
.stat b {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.toast {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 72px;
  background: rgba(28, 28, 28, 0.92);
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  z-index: 7;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  top: 74px;
  bottom: 58px;
  background: rgba(23, 21, 19, 0.42);
  display: flex;
  align-items: flex-end;
  z-index: 6;
}
.panel {
  width: 100%;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px 14px 22px;
  max-height: 78%;
  overflow: auto;
}
.panel h3 { margin: 0 0 8px; font-size: 17px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.warnbox {
  margin: 10px 0;
  padding: 8px 10px;
  background: var(--amber-bg);
  color: #5c3d0c;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}
.panel .sides { margin-top: 12px; }
.panel .ghost { width: 100%; margin-top: 8px; height: 36px; }

#guide h2 { margin: 0 0 8px; font-size: 20px; }
#guide h3 { margin: 22px 0 8px; font-size: 15px; }
#guide p { color: var(--muted); line-height: 1.55; }

.steps { list-style: none; padding: 0; margin: 0; }
.steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(36, 32, 24, 0.08);
  font-size: 14px;
  line-height: 1.45;
}
.steps i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.steps li.done i { background: var(--navy); color: #fff; border-color: var(--navy); }

.machine { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.machine li {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}
.machine li.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.simgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.simgrid button, .toggle {
  border: 1px solid #d9d2c6;
  background: #fff;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 10px;
}
.simgrid button:disabled { opacity: 0.4; cursor: not-allowed; }
.toggle.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.audit { list-style: none; padding: 0; margin: 0; }
.audit li {
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(36, 32, 24, 0.06);
  font-variant-numeric: tabular-nums;
}

.search {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  margin-bottom: 8px;
  background: #fff;
}

.banner {
  background: var(--amber-bg);
  color: #5c3d0c;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 8px;
}

@media (max-width: 860px) {
  .top, .stage { grid-template-columns: 1fr; }
  .bezel { margin: 0 auto; }
}
