/* 交易台（/api/pm/* 版块）—— 全部类名加 pm- 前缀，避免和主站样式打架 */

/* 问题：交易台的数字要能一眼看出红绿，主站没有对应类，这里自己定 */
#page-pm { padding-bottom: 28px; }

.pm-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.pm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.pm-stat { display: flex; flex-direction: column; gap: 2px; }
.pm-stat i { font-style: normal; font-size: 11px; color: var(--muted); }
.pm-stat b { font-size: 18px; letter-spacing: .2px; }
.pm-stat span { font-size: 11px; }

.pm-up { color: #35c07a; }
.pm-down { color: var(--red); }
.pm-dim { color: var(--muted); }
.pm-hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.pm-hint code { background: var(--card2); padding: 1px 4px; border-radius: 4px; }

.pm-meta { font-size: 11px; color: var(--muted); margin: 6px 2px 10px; line-height: 1.7; }

.pm-warn {
  background: rgba(229, 72, 77, .12);
  border: 1px solid rgba(229, 72, 77, .45);
  color: #ff9a9d;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  margin: 0 0 10px;
}

.pm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.pm-acts button { flex: 1 1 84px; padding: 9px 8px; font-size: 13px; }
.pm-danger { color: #ff8d90; border-color: rgba(229, 72, 77, .5) !important; }
.btn-solid.pm-paused { background: var(--red); color: #fff; }

.pm-h {
  font-size: 13px;
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pm-h .pm-dim { font-size: 11px; font-weight: 400; }

/* 持仓表：手机上横向滚动，别把页面撑宽 */
.pm-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.pm-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 620px; }
.pm-table th {
  text-align: left; font-weight: 400; font-size: 11px; color: var(--muted);
  padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.pm-table td { padding: 8px; border-bottom: 1px solid rgba(38, 44, 56, .55); vertical-align: top; }
.pm-table tr:last-child td { border-bottom: 0; }
.pm-table .pm-q { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-mini { padding: 4px 8px; font-size: 11px; }

/* 参数表 */
.pm-params summary { cursor: pointer; font-size: 13px; }
.pm-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.pm-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.pm-field i { font-style: normal; font-size: 10px; }
.pm-field .input { padding: 7px 9px; font-size: 13px; }
.pm-form-foot { margin-top: 12px; align-items: center; }

.pm-row { display: flex; gap: 8px; align-items: center; }
.pm-row .input { flex: 1; }
.pm-login h4 { margin: 2px 0 6px; font-size: 14px; }

/* 事件 */
.pm-events { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.pm-ev {
  display: grid;
  grid-template-columns: 96px 54px 1fr;
  gap: 6px;
  padding: 7px 10px;
  font-size: 12px;
  border-bottom: 1px solid rgba(38, 44, 56, .5);
}
.pm-ev:last-child { border-bottom: 0; }
.pm-ev b { font-weight: 400; color: var(--gold); font-size: 11px; }
.pm-ev em { grid-column: 2 / -1; font-style: normal; font-size: 11px; }
.pm-ev.bad b { color: var(--red); }

.pm-pager { justify-content: center; margin-top: 10px; }
.pm-pager button { padding: 6px 12px; font-size: 12px; }
.pm-sel { width: auto; padding: 4px 8px; font-size: 11px; }

.pm-logs {
  background: #0a0c10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 11px;
  line-height: 1.7;
  color: #b7c0cf;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.pm-toast {
  position: fixed; left: 50%; bottom: 78px; transform: translate(-50%, 12px);
  background: rgba(22, 26, 34, .96); border: 1px solid var(--line); color: var(--text);
  padding: 9px 14px; border-radius: 20px; font-size: 12px; max-width: 82vw;
  opacity: 0; pointer-events: none; transition: all .18s ease; z-index: 60;
}
.pm-toast.show { opacity: 1; transform: translate(-50%, 0); }
.pm-toast.bad { border-color: rgba(229, 72, 77, .6); color: #ffb3b5; }

@media (max-width: 420px) {
  .pm-form { grid-template-columns: 1fr; }
  .pm-grid { gap: 6px; }
  .pm-stat b { font-size: 16px; }
}

/* ===== 扫码登录（交易台） ===== */
.pm-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0 2px;
  text-align: center;
}
.pm-qr-img {
  width: 220px;
  height: 220px;
  max-width: 60vw;
  max-height: 60vw;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  box-sizing: content-box;
}
.pm-qr-box .pm-row { justify-content: center; }
.pm-qr-fallback {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}
.pm-qr-fallback summary { cursor: pointer; user-select: none; }
.pm-qr-fallback .pm-row { margin-top: 8px; }

/* 导航页底部的交易台入口 */
.pm-entry-title {
  margin: 6px 4px 8px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--muted);
  opacity: .8;
}
/* 下面的列表在 .nav-full（grid）里会被拉满，这张独立卡片要自己撑满 */
.nav-card.pm-entry {
  margin-top: 0;
  width: 100%;
  box-sizing: border-box;
}