* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #f4ecd8;
  color: #2a2520;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 12px;
  border-top: 3px solid #2a2520;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.up { color: #2d5f3a; }
.down { color: #8f2a2a; }

/* 顶部导航 */
.topbar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  background: #ede5d0;
  border-bottom: 1px solid #ddd3bb;
}
.logo { font-size: 19px; font-weight: 500; margin-right: 16px; }
.nav { display: flex; }
.nav a { padding: 12px 12px; color: #7a7060; font-weight: 600; }
.nav a.active { color: #2a2520; border-bottom: 2px solid #2a2520; }
.actions { margin-left: auto; display: flex; gap: 34px; color: #7a7060; font-weight: 600; }
.actions .connect { margin-left: 12px; }

/* 主体 */
.layout { display: flex; padding: 0 0 0 0; }

.chart-box {
  flex: 1;
  position: relative;
  height: 560px;
  min-width: 0;
}
#chart { width: 100%; height: 100%; display: block; }

.ticker {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  gap: 14px;
  z-index: 2;
}
.pair, .stats {
  display: flex;
  align-items: center;
  background: #faf6ed;
  border: 1px solid #ddd3bb;
  border-radius: 4px;
  height: 36px;
}
.pair { padding: 0 14px 0 0; gap: 10px; min-width: 260px; }
.coin {
  width: 32px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: #e3dccb; font-size: 30px; font-weight: 700;
  margin-right: -26px;
}
.pair b { font-size: 16px; position: relative; padding-right: 8px; border-right: 1px solid #ddd3bb; }
.price { font-size: 15px; font-weight: 500; }
.chg { margin-left: auto; font-size: 11px; }
.caret { color: #7a7060; margin-top: -6px; }

.stats { background: rgba(237, 229, 208, .55); }
.stat {
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border-right: 1px solid #ddd3bb;
}
.stat:last-child { border-right: 0; }
.stat small { font-size: 9px; color: #7a7060; letter-spacing: 1px; }
.stat b { font-size: 13px; font-weight: 500; }
.tick { font-size: 12px; font-weight: 500; }
.live { color: #2d5f3a; font-size: 11px; font-weight: 700; }

/* 右侧下单栏 */
.side {
  width: 260px;
  padding: 12px 12px 0 16px;
  background: #f4ecd8;
  border-left: 1px solid #ddd3bb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row { display: flex; justify-content: space-between; color: #7a7060; font-size: 11px; font-weight: 500; }
.row b { color: #2a2520; }
.row.pad { padding: 0 2px; }
.row.tiny { font-size: 9px; font-weight: 400; margin-top: -4px; }

.equity { background: #ede5d0; border-radius: 6px; padding: 8px 10px; }
.eq-head { display: flex; justify-content: space-between; font-weight: 600; padding-bottom: 5px; border-bottom: 1px solid #ddd3bb; cursor: pointer; }
.eq-body { padding-top: 5px; display: flex; flex-direction: column; gap: 4px; }

.switch {
  display: flex;
  background: #faf6ed;
  border: 1px solid #ddd3bb;
  border-radius: 4px;
  padding: 2px;
}
.switch button { flex: 1; padding: 6px 0; border-radius: 3px; color: #7a7060; font-weight: 600; }
.switch button.on.long { background: #d9ddd0; color: #2d5f3a; }
.switch button.on.short { background: #e8d3cc; color: #8f2a2a; }

.label { text-align: right; font-size: 11px; font-weight: 600; color: #7a7060; letter-spacing: .5px; margin-bottom: -2px; }
.input-row { display: flex; gap: 6px; }
.mini {
  background: #ede5d0;
  border: 1px solid #ddd3bb;
  border-radius: 3px;
  padding: 0 8px;
  font-size: 10px;
  color: #7a7060;
}
.input-row input {
  flex: 1;
  min-width: 0;
  height: 26px;
  border: 1px solid #ddd3bb;
  border-radius: 3px;
  background: #faf6ed;
  text-align: right;
  padding: 0 8px;
  font: inherit;
  font-weight: 600;
}

#levSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #2d5f3a, #c9bfa6 50%, #8f2a2a);
  margin: 6px 0 2px;
}
#levSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #faf6ed;
  border: 2px solid #2a2520;
}
#levSlider::-moz-range-thumb {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #faf6ed;
  border: 2px solid #2a2520;
}

.big-btn {
  margin-top: 6px;
  background: #7a6235;
  color: #f4ecd8;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
  border-radius: 4px;
}

.open-pos {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #ddd3bb;
  color: #7a7060;
  font-weight: 600;
  font-size: 11px;
}
.close-all { background: #faf6ed; border: 1px solid #ddd3bb; border-radius: 3px; padding: 2px 10px; font-size: 10px; color: #7a7060; }

/* 底部 */
.bottom { border-top: 1px solid #ddd3bb; }
.tabs {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid #ddd3bb;
}
.tabs button { padding: 0 14px; height: 40px; font-size: 11px; font-weight: 600; color: #7a7060; }
.tabs button.active { color: #2a2520; border-bottom: 2px solid #2a2520; }
.tabs .menu { margin-left: 12px; font-size: 16px; color: #7a7060; }

.marquee { flex: 1; overflow: hidden; margin-left: 20px; }
.track { display: flex; gap: 14px; width: max-content; animation: scroll 40s linear infinite; }
.chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #faf6ed;
  border: 1px solid #ddd3bb;
  border-radius: 3px;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}
.chip i { font-style: normal; color: #d8cfba; font-size: 18px; margin-right: 2px; }
.brand { color: #e3dacb; font-weight: 600; letter-spacing: 2px; font-size: 11px; white-space: nowrap; align-self: center; }
@keyframes scroll { to { transform: translateX(-50%); } }

.empty { text-align: center; color: #7a7060; padding: 18px 0 240px; font-size: 11px; }

/* 移动端 */
@media (max-width: 768px) {
  body { font-size: 14px; }
  .pc-only { display: none; }

  .topbar { flex-wrap: wrap; height: auto; padding: 8px 14px 0; background: #f4ecd8; }
  .logo { width: 100%; font-size: 26px; }
  .logo span { display: none; }
  .actions { order: 2; width: 100%; justify-content: flex-end; gap: 30px; padding: 12px 0; font-size: 16px; font-weight: 500; }
  .nav { order: 3; width: 100%; }
  .nav a { font-size: 15px; padding: 10px 9px; white-space: nowrap; }

  .layout { flex-direction: column; padding: 6px; }
  .chart-box { flex: none; height: 440px; background: #faf6ed; border-radius: 8px; }
  .ticker { flex-direction: column; left: 16px; right: 100px; gap: 10px; }
  .pair { min-width: 0; width: 270px; height: 40px; }
  .pair b { font-size: 16px; }
  .price { font-size: 18px; }
  .chg { font-size: 15px; }
  .stats { flex-wrap: wrap; height: auto; width: 100%; }
  .stat { flex: 1; flex-direction: column; align-items: flex-start; padding: 8px 10px; height: auto; border-right: 0; gap: 2px; }
  .stat small { font-size: 11px; }
  .stat b { font-size: 16px; }
  .stat.tick, .stat.live { flex: 1 0 50%; align-items: center; border-top: 1px solid #ddd3bb; font-size: 15px; }
  .stat.tick { border-right: 1px solid #ddd3bb; }

  .side { width: 100%; border-left: 0; margin-top: 6px; padding: 14px 16px; border-radius: 8px; background: #faf6ed; gap: 12px; }
  .row { font-size: 14px; }
  .label { font-size: 14px; }
  .mini { font-size: 13px; padding: 0 12px; }
  .input-row input { height: 36px; font-size: 15px; }
  .big-btn { font-size: 16px; padding: 14px 0; }

  .tabs { overflow: hidden; }
  .marquee { display: none; }
}
