/* paper.css — 模擬倉（模擬倉.html／page-paper.jsx）。Ledger 淺色、台股紅漲綠跌（--up／--dn） */
.pp { max-width: 1240px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 18px; }
.pp-status { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; padding: 10px 14px; background: var(--surface, #fff); border: 1px solid var(--line, #dedad0); border-radius: 10px; font-family: var(--font-mono, 'IBM Plex Mono', monospace); font-size: 12px; color: var(--ink-soft, #5b5f54); }
.pp-status b { color: var(--ink, #20241f); font-weight: 500; }
.pp-live { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.pp-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pp-dot.ok { background: var(--dn, #2e7d4f); box-shadow: 0 0 0 4px rgba(46, 125, 79, .16); }
.pp-dot.warn { background: #a3701f; box-shadow: 0 0 0 4px rgba(163, 112, 31, .16); }
.pp-head { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; }
.pp-head h1 { margin: 0; font-family: var(--font-cn, 'Noto Serif TC', serif); font-size: clamp(26px, 3.6vw, 34px); }
.pp-head p { margin: 0; color: var(--ink-soft, #5b5f54); }
.pp-card { background: var(--surface, #fff); border: 1px solid var(--line, #dedad0); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pp-card h2 { margin: 0; font-size: 17px; font-weight: 600; }
.pp-sub { font-size: 12px; color: var(--ink-soft, #5b5f54); }
.pp-mono { font-family: var(--font-mono, 'IBM Plex Mono', monospace); }
.pp-up { color: var(--up, #c0392b); } .pp-dn { color: var(--dn, #2e7d4f); }
.pp-row { display: flex; flex-wrap: wrap; gap: 16px; }
.pp-row > * { flex: 1 1 420px; }
.pp-grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }

/* 交易台卡 */
.pp-desk-top { display: flex; gap: 12px; align-items: center; }
.pp-badge { width: 46px; height: 46px; border-radius: 12px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex: none; font-family: var(--font-mono, monospace); }
.pp-desk-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-desk-name b { font-size: 15px; }
.pp-pill { font-family: var(--font-mono, monospace); font-size: 11px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pp-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line, #dedad0); border-radius: 8px; overflow: hidden; }
.pp-kpis > div { background: #f7f5f0; padding: 6px 8px; display: flex; flex-direction: column; }
.pp-kpis span { font-size: 10px; color: var(--ink-soft, #5b5f54); }
.pp-kpis b { font-family: var(--font-mono, monospace); font-size: 14px; font-weight: 500; }

/* 動態牆 */
.pp-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.pp-feed li { display: grid; grid-template-columns: 46px 26px 1fr; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid #ece9e1; font-size: 13px; }
.pp-feed .pp-badge { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }

/* 稽核帶 */
.pp-band { position: relative; height: 26px; background: #f7f5f0; border-radius: 6px; }
.pp-band .zero { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #c9c5ba; }
.pp-band .ci { position: absolute; top: 7px; height: 12px; background: #c9c5ba; border-radius: 3px; }
.pp-band .pt { position: absolute; top: 4px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; border: 2px solid #fff; }
.pp-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-mute, #6f7368); }

/* 長期曲線 */
.pp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; }
.pp-legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.pp-hist svg { width: 100%; height: auto; display: block; }
.pp-tbl { overflow-x: auto; }
.pp-tbl table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pp-tbl th { text-align: left; font-size: 11px; font-weight: 500; color: var(--ink-soft, #5b5f54); padding: 6px 8px; border-bottom: 1px solid var(--line, #dedad0); white-space: nowrap; }
.pp-tbl td { padding: 7px 8px; border-bottom: 1px solid #ece9e1; white-space: nowrap; }
.pp-tbl td.num, .pp-tbl th.num { text-align: right; font-family: var(--font-mono, monospace); }
.pp-tbl tr.sel td { background: #e4ece8; }
.pp-tbl tr.click { cursor: pointer; }
.pp-tbl tr.click:hover td { background: #f3f1ec; }
.pp-note { padding: 12px 14px; border-radius: 10px; background: #f6ecd9; color: #4a3510; font-size: 13px; line-height: 1.7; }
.pp-tabs { display: inline-flex; gap: 4px; padding: 3px; background: #f0ede6; border-radius: 8px; flex-wrap: wrap; }
.pp-tabs button { font: inherit; font-size: 13px; border: 0; border-radius: 6px; padding: 7px 12px; min-height: 36px; cursor: pointer; background: transparent; color: var(--ink-soft, #5b5f54); }
.pp-tabs button.on { background: #fff; color: var(--ink, #20241f); font-weight: 600; }
.pp-owner { border: 1px dashed #a3701f; }
.pp-why { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.pp-why.tp { background: var(--up-bg, #f8e4e1); color: #8e2a20; }
.pp-why.sl { background: var(--dn-bg, #e2f1e7); color: #1f5a38; }
.pp-why.time, .pp-why.gap { background: #efece5; color: #3c4038; }
@media (max-width: 700px) { .pp-feed li { grid-template-columns: 40px 26px 1fr; } }

/* K 線回放：圖＋交易單 */
.pp-replay-head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.pp-replay-head h2 { margin-right: auto; }
.pp-replay { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.pp-replay-chart { flex: 999 1 600px; min-width: 0; }
.pp-replay-chart .ta-chart { border: 0; padding: 0; }
.pp-ticket { flex: 1 1 280px; max-width: 100%; border: 1px solid var(--line, #dedad0); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fbfaf7; align-self: flex-start; }
.pp-ticket-top { display: flex; gap: 8px; align-items: center; }
.pp-ticket-name { font-family: var(--font-cn, 'Noto Serif TC', serif); font-size: 22px; line-height: 1.2; }
.pp-ticket-ret { font-size: 36px; font-weight: 600; line-height: 1.05; }
.pp-ticket-cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line, #dedad0); border-radius: 8px; overflow: hidden; }
.pp-ticket-cmp > div { background: #fff; padding: 7px 8px; display: flex; flex-direction: column; }
.pp-ticket-cmp span { font-size: 10px; color: var(--ink-soft, #5b5f54); }
.pp-ticket-cmp b { font-size: 14px; font-weight: 500; }
.pp-steps { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; position: relative; }
.pp-steps::before { content: ''; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; background: var(--line, #dedad0); }
.pp-steps li { display: grid; grid-template-columns: 18px 36px 1fr auto; gap: 6px; align-items: center; padding: 5px 0; font-size: 13px; position: relative; }
.pp-step-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 3px #fbfaf7; z-index: 1; }
.pp-step-k { font-weight: 600; }
.pp-step-v { text-align: right; }
.pp-mfe { display: flex; flex-direction: column; gap: 6px; }
.pp-mfe-bar { position: relative; height: 12px; border-radius: 6px; overflow: visible; background: #ece9e1; }
.pp-mfe-neg { position: absolute; top: 0; bottom: 0; background: var(--dn-bg, #e2f1e7); border-radius: 6px 0 0 6px; }
.pp-mfe-pos { position: absolute; top: 0; bottom: 0; background: var(--up-bg, #f8e4e1); border-radius: 0 6px 6px 0; }
.pp-mfe-zero { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink-mute, #6f7368); }
.pp-mfe-exit { position: absolute; top: -5px; width: 12px; height: 22px; margin-left: -6px; border-radius: 3px; background: var(--accent, #2f5d52); border: 2px solid #fff; }
.pp-ticket-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.pp-ticket-nav button { font: inherit; font-size: 13px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line, #dedad0); border-radius: 8px; background: #fff; cursor: pointer; color: var(--ink, #20241f); }
.pp-tabs button[aria-pressed="true"] { background: #fff; color: var(--ink, #20241f); font-weight: 600; }
