/* 三款模拟页面共用的结构样式，颜色全部由各款式的 CSS 变量决定 */
:root {
  --up: #f0484e;
  --down: #17b07b;
  --ma1: #f2b843;
  --ma2: #4aa3ff;
  --ma3: #c873ff;
  --r: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}
button, input { font: inherit; color: inherit; border: 0; background: none; outline: none; }
button { cursor: pointer; }
b, .num { font-variant-numeric: tabular-nums; }

.app { max-width: 480px; height: 100%; margin: 0 auto; display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--bg); }
.pages { flex: 1; position: relative; overflow: hidden; }
.page { position: absolute; inset: 0; overflow-y: auto; display: none; scrollbar-width: none; }
.page::-webkit-scrollbar { display: none; }
.page.active { display: block; }
.page.col.active { display: flex; flex-direction: column; }

.up { color: var(--up); }
.down { color: var(--down); }

[data-icon] { display: inline-flex; flex: none; font-style: normal; }
[data-icon] svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* 底部导航 */
.tabbar { display: flex; flex: none; height: 56px; background: var(--bar); border-top: 1px solid var(--line); z-index: 5; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--dim); }
.tabbar button.active { color: var(--brand); }
.tabbar [data-icon] { width: 22px; height: 22px; }

/* 轮播图 */
.banner { position: relative; overflow: hidden; border-radius: var(--r); }
.banner-track { display: flex; transition: transform .5s ease; }
.banner-track > * { flex: 0 0 100%; min-width: 0; }
.banner-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; }
.banner-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .4); transition: .3s; }
.banner-dots i.on { width: 14px; background: #fff; }

/* 滚动公告 */
.notice { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; font-size: 12px; }
.notice [data-icon] { width: 16px; height: 16px; color: var(--brand); }
.notice-view { flex: 1; height: 36px; overflow: hidden; }
.notice-roll { transition: transform .5s; }
.notice-roll p { height: 36px; line-height: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 涨跌幅色块 */
.pct { min-width: 74px; padding: 6px 0; border-radius: 6px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pct.up { background: var(--up); color: #fff; }
.pct.down { background: var(--down); color: #fff; }
.spark { display: block; }

/* 交易页：产品选择、周期、K 线 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 14px; border-radius: 16px; font-size: 13px; color: var(--dim); background: var(--card); border: 1px solid var(--line); }
.chip.on { background: var(--brand); color: var(--on-brand); border-color: transparent; font-weight: 600; }
.periods { display: flex; padding: 0 8px; border-bottom: 1px solid var(--line); }
.periods button { flex: 1; padding: 9px 0; font-size: 12px; color: var(--dim); position: relative; }
.periods button.on { color: var(--brand); font-weight: 600; }
.periods button.on::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 16px; height: 2px; margin-left: -8px; border-radius: 2px; background: var(--brand); }
.chart { height: 290px; position: relative; }
.chart canvas { width: 100%; height: 100%; display: block; }

.btn-up { background: var(--up); color: #fff; }
.btn-down { background: var(--down); color: #fff; }

/* 购买记录 */
.rtabs { display: flex; gap: 22px; padding: 12px 16px 0; border-bottom: 1px solid var(--line); }
.rtabs button { padding-bottom: 9px; font-size: 14px; color: var(--dim); position: relative; }
.rtabs button.on { color: var(--text); font-weight: 600; }
.rtabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.rec { margin: 10px 12px; padding: 12px; background: var(--card); border-radius: var(--r); }
.rec-top { display: flex; align-items: center; gap: 8px; }
.rec-top small { color: var(--dim); font-size: 11px; }
.tag { padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.tag.up { background: var(--up); color: #fff; }
.tag.down { background: var(--down); color: #fff; }
.rec-pnl { margin-left: auto; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; font-size: 11px; color: var(--dim); }
.rec-grid em { display: block; margin-top: 2px; font-style: normal; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.rec-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--dim); }
.rec-foot button { padding: 5px 16px; border-radius: 14px; border: 1px solid var(--brand); color: var(--brand); font-size: 12px; }
.empty { padding: 40px 0; text-align: center; color: var(--dim); font-size: 13px; }

/* 下单面板 */
.mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: .25s; z-index: 20; }
.mask.on { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; background: var(--card); border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .28s ease; z-index: 21; }
.sheet.on { transform: none; }
.sheet-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-hd b { font-size: 16px; margin-right: 8px; }
.sheet-hd span { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-hd button { width: 28px; height: 28px; color: var(--dim); font-size: 15px; }
.sheet-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 12px; font-size: 12px; color: var(--dim); }
.sheet-row label { font-size: 13px; flex: none; }
.sheet-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-amt { display: block; width: 100%; height: 44px; padding: 0 12px; margin-bottom: 8px; border-radius: 8px; background: var(--bg); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-amt::placeholder { font-size: 13px; font-weight: 400; color: var(--dim); }
/* 快捷金额，以及止盈止损比例的选项（修改止盈止损的弹窗里也用） */
.sheet-quick { display: flex; gap: 6px; margin-bottom: 12px; }
.sheet-quick button, .sheet-opt button { flex: 1; min-width: 0; height: 32px; padding: 0 2px; border-radius: 6px; background: var(--bg); color: var(--dim); font-size: 12px; white-space: nowrap; }
.sheet-quick button.on, .sheet-opt button.on { color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.sheet-opt { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sheet-opt label { flex: none; width: 30px; color: var(--dim); font-size: 13px; }
.sheet-opt > div { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-opt button { flex: 1 0 auto; min-width: 46px; padding: 0 6px; }
.sheet-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 10px 0 14px; margin-top: 2px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); }
.sheet-sum span { display: flex; justify-content: space-between; gap: 6px; white-space: nowrap; }
.sheet-sum b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.modal .sheet-opt { margin: 0 0 12px; text-align: left; }
.modal .sheet-opt button { flex: 0 0 auto; padding: 0 10px; }
/* 模拟交易下单面板里的说明文字 */
.sheet-note { margin: 0 0 10px; font-size: 12px; line-height: 1.5; color: var(--dim); }
/* 账户权益不够、不能选的止盈档 */
.sheet-opt button.locked { opacity: .4; }
/* 持仓记录里止盈止损比例后面的触发价 */
.rec-grid em i { margin-left: 3px; font-style: normal; font-size: 11px; color: var(--dim); }
.sheet-ok { width: 100%; height: 46px; border-radius: 10px; font-size: 16px; font-weight: 600; }

/* 轻提示 */
.toast { position: absolute; left: 50%; top: 45%; max-width: 76%; padding: 10px 16px; border-radius: 8px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 13px; text-align: center; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 30; }
.toast.on { opacity: 1; }

.risk { padding: 16px 0 20px; text-align: center; font-size: 11px; color: var(--dim); opacity: .8; }
