* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }

:root {
  --blue: #1B5CFF;
  --blue-ink: #1B4DD6;
  --blue-soft: #EEF3FF;
  --ink: #0E1218;
  --ink2: #59616E;
  --ink3: #8A919C;
  --line: #E8EAEE;
  --bg: #F6F7F9;
  --card: #fff;
  --gold: #B4761A;
  --gold-soft: #FBF4E7;
  --green: #0FA968;
  --red: #E5484D;
  --card-line: #ECEEF2;
  --radius: 12px;
  --pad: 16px;
}

html, body {
  height: 100%;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}

body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
#app { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ---------- shell ---------- */
.appbar {
  flex: none; padding: 12px var(--pad) 8px; display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
}
.appbar .t { font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.appbar .u { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink2); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #E7ECF4;
  color: #3C4A60; font-size: 11.5px; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none;
}
.notice {
  flex: none; margin: 0 var(--pad) 8px; padding: 7px 11px; border-radius: 8px;
  background: var(--gold-soft); color: #8A5A12; border: 1px solid #F0E2C8;
  font-size: 12px; line-height: 1.5; display: flex; gap: 6px;
}
.notice:empty { display: none; }

/* 收盘 / 休市时告诉客户「为什么现在报不了价、什么时候能报」 */
.sessioncard {
  flex: none; padding: 11px 12px; border-radius: var(--radius); background: #FFFCF6;
  border: 1px solid #F0D9AE; display: flex; gap: 10px; align-items: flex-start;
}
.sessioncard[hidden] { display: none; }
.sessioncard .ic {
  width: 16px; height: 20px; color: #B4761A;
  flex: none; display: flex; align-items: center; justify-content: center;
}
.sessioncard .tt { font-size: 13px; font-weight: 600; color: #6E4609; }
.sessioncard .dd { font-size: 12px; color: #8A6A33; line-height: 1.5; margin-top: 1px; }
.closedtip {
  margin-top: 10px; padding: 8px 10px; border-radius: 9px; background: #FFF6E8;
  border: 1px solid #F5DDB4; color: #8A5A12; font-size: 12.5px; line-height: 1.55; text-align: left;
}
.closedtip[hidden] { display: none; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 var(--pad) 20px; display: flex; flex-direction: column; gap: 8px; }
.submitbar { flex: none; padding: 8px var(--pad) calc(8px + env(safe-area-inset-bottom)); background: var(--bg); }

.tabbar {
  flex: none; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  padding: 5px 0 calc(5px + env(safe-area-inset-bottom));
}
.tabbar .tab {
  position: relative; min-width: 0; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--ink3); background: none; border: 0; padding: 0 2px; font-family: inherit;
}
.tabbar .tab.on { color: var(--blue-ink); font-weight: 600; }
.tabbar .tab svg { width: 21px; height: 21px; }
.tabbar .tab-label { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.tabbar .tab .badge {
  position: absolute; top: 2px; left: calc(50% + 7px); background: var(--red); color: #fff;
  border-radius: 9px; font-size: 9px; padding: 1px 4px; min-width: 15px; height: 15px;
  text-align: center; line-height: 13px; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- primitives ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--card-line); }
.label { font-size: 14px; font-weight: 600; }
.hint { font-size: 12px; color: var(--ink3); font-weight: 400; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.divider { height: 1px; background: #EDEFF3; margin: 10px 0; }
.link { font-size: 12.5px; color: var(--ink2); }
.muted { color: var(--ink3); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip {
  background: var(--blue-soft); color: var(--blue); font-size: 12.5px; font-weight: 600;
  padding: 6px 9px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; border: 0; font-family: inherit;
}
.chip b { font-weight: 400; color: #7E9DE0; font-size: 14px; }
.chip-add { background: #fff; border: 1px dashed #C6D2E4; color: var(--ink2); font-weight: 500; }

.opts { display: flex; gap: 6px; margin-top: 9px; }
.opts.grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.opts.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.opt {
  position: relative; flex: 1; text-align: center; padding: 9px 4px; border-radius: 8px;
  border: 1px solid #E4E7EC; font-size: 13px; color: var(--ink2); background: #fff;
  white-space: nowrap; font-family: inherit;
}
.opt.on { border-color: var(--blue); border-width: 1.5px; color: var(--blue-ink); font-weight: 600; background: #F2F6FF; }
.opt em { display: none; }
.rule-row { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.rule-row .rule-name { width: 60px; flex: none; font-size: 12.5px; color: #6B7380; }
.rule-row .opt { padding: 9px 4px; }

textarea, input[type="text"], input[type="tel"], input[type="password"], input[type="number"] {
  width: 100%; border: 1px solid #E9ECF2; border-radius: 9px; padding: 10px 11px;
  font-size: 13px; font-family: inherit; color: var(--ink); background: #FAFBFC; outline: none;
}
textarea:focus, input:focus { border-color: #B9CDF7; background: #fff; }
textarea { resize: none; min-height: 62px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
.field { margin-top: 10px; }
.field-label { font-size: 12.5px; color: var(--ink2); margin-bottom: 6px; }

.btn {
  width: 100%; height: 46px; border-radius: var(--radius); border: 0; font-size: 15px; font-weight: 600;
  color: #fff; background: #12161C; font-family: inherit; letter-spacing: .2px;
}
.btn:disabled { opacity: .32; }
.btn.ghost { background: #fff; color: var(--blue-ink); border: 1px solid #DAE2F2; }
.btn.sm { height: 36px; width: auto; padding: 0 16px; font-size: 13px; border-radius: 9px; }
.btn.block-sm { width: 100%; height: 42px; font-size: 13.5px; border-radius: 9px; }

/* ---------- quote cards ---------- */
.quote-head { background: #fff; border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--card-line); }
.ticker { display: flex; align-items: center; gap: 7px; }
.mkt { font-size: 10px; padding: 1.5px 5px; border-radius: 4px; border: 1px solid #E2B4B4; color: #C04747; background: #FDF3F3; }
.mkt.sh { color: #3E7BB6; border-color: #B4CDE2; background: #F1F7FD; }
.name { font-size: 15.5px; font-weight: 700; }
.code { font-size: 12px; color: var(--ink3); }
.tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag { font-size: 11.5px; padding: 2.5px 7px; border-radius: 5px; background: #F2F4F8; color: var(--ink2); }
.tag.blue { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.tag.green { background: #EAF7F0; color: var(--green); font-weight: 600; }
.tag.red { background: #FDEDED; color: var(--red); font-weight: 600; }
.tag.gold { background: var(--gold-soft); color: var(--gold); font-weight: 600; }

.grp-title { display: flex; align-items: center; gap: 8px; margin: 4px 2px 0; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.grp-title .line { flex: 1; height: 1px; background: #E4E8EF; }

.q { background: #fff; border-radius: var(--radius); padding: 13px 15px; border: 1px solid var(--card-line); }
.q.expired { opacity: .55; }
.q .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.q .rate { font-size: 26px; font-weight: 700; color: var(--blue); letter-spacing: -.5px; line-height: 1.05; }
.q .rate small { font-size: 15px; font-weight: 600; }
.q .pill { font-size: 10px; padding: 2px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 6px; font-weight: 600; display: inline-block; }
.q .pill.best { background: #FFF0E6; color: #E0642B; }
.q .pill.strong { background: #F1F8F3; color: #12A05E; }
.q .cap { font-size: 12px; color: var(--ink3); margin-top: 4px; }
.q .right { text-align: right; flex: none; width: 128px; }
.q .amt { font-size: 17px; font-weight: 700; }
.q .amt span { font-size: 12px; color: var(--ink3); font-weight: 400; }
.q .rules { margin-top: 11px; background: #F7F8FA; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--ink2); line-height: 1.5; }
.q .valid { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #A96A12; margin-top: 9px; }
.q .valid.expired { color: var(--ink3); }
.q .quote-remark { margin-top: 8px; font-size: 12px; color: var(--ink2); background: #FFFBF3; border-radius: 8px; padding: 7px 9px; }

.empty { text-align: center; padding: 44px 20px; color: var(--ink3); font-size: 13px; line-height: 1.7; }
.empty svg { width: 40px; height: 40px; opacity: .28; margin-bottom: 12px; }

/* ---------- sheet ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 20, 28, .45); z-index: 50;
  display: flex; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity .18s;
}
.mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; background: #fff; border-radius: 18px 18px 0 0; max-height: 78dvh;
  display: flex; flex-direction: column; transform: translateY(12px); transition: transform .18s;
}
.mask.show .sheet { transform: none; }
.sheet-head { padding: 16px 18px 10px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.sheet-head .st { font-size: 16px; font-weight: 700; }
.sheet-head button { background: none; border: 0; font-size: 14px; color: var(--ink2); font-family: inherit; }
.sheet-body { padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; flex: 1; }

.sr { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid #F5F6F9; }
.sr:last-child { border-bottom: 0; }
.sr .srn { font-size: 14.5px; font-weight: 600; }
.sr .src { font-size: 12px; color: var(--ink3); margin-top: 3px; }
.sr .add { font-size: 12.5px; color: var(--blue); font-weight: 600; }
.sr .add.done { color: var(--ink3); font-weight: 400; }

/* ---------- 客户站内消息 ---------- */
.chat-appbar { padding-top: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.chat-appbar .u { margin-top: 2px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-profile-link {
  flex: none; min-width: 52px; height: 38px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink2); font: 500 12.5px/1 inherit;
}
.chat-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 14px var(--pad) 18px; display: flex; flex-direction: column; gap: 13px; background: #F7F8FA;
}
.chat-message-row { display: flex; align-items: flex-start; gap: 8px; }
.chat-message-row.mine { justify-content: flex-end; }
.chat-avatar {
  width: 28px; height: 28px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #E3EAF5; color: #40526B; font-size: 11.5px; font-weight: 700;
}
.chat-message-main { min-width: 0; max-width: min(78%, 560px); display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.chat-message-row.mine .chat-message-main { align-items: flex-end; }
.chat-bubble {
  padding: 9px 12px; border-radius: 4px 12px 12px 12px; background: #fff; border: 1px solid var(--card-line);
  color: var(--ink); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-bubble.mine { border: 0; border-radius: 12px 4px 12px 12px; background: #1B5CFF; color: #fff; }
.chat-message-time { font-size: 10.5px; color: var(--ink3); padding: 0 2px; }
.chat-system-card {
  align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  width: 100%; padding: 12px 13px; border: 1px solid #DDE5F1; border-radius: 10px;
  background: #F5F8FE; color: var(--ink); text-align: left; font-family: inherit;
}
.chat-system-label { font-size: 11px; color: var(--blue-ink); font-weight: 600; }
.chat-system-body { font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.chat-system-link { font-size: 11.5px; color: var(--ink3); }
.chat-inquiry-ref {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  width: min(300px, 76vw); padding: 11px 12px; border: 1px solid #DDE5F1;
  border-radius: 10px; background: #F8FAFE; color: var(--ink); text-align: left; font-family: inherit;
}
.chat-inquiry-ref-label { color: var(--blue-ink); font-size: 11px; font-weight: 600; }
.chat-inquiry-ref b { font-size: 13.5px; line-height: 1.4; }
.chat-inquiry-ref small { color: var(--ink2); font-size: 11.5px; line-height: 1.45; }
.chat-inquiry-ref-link { margin-top: 3px; color: var(--ink3); font-size: 11px; }
.chat-image {
  display: block; width: min(220px, 64vw); min-height: 72px; padding: 0; overflow: hidden;
  border: 0; border-radius: 10px; background: #E9EDF3; color: var(--ink3); font-family: inherit;
}
.chat-image img { display: block; width: 100%; max-height: 280px; object-fit: contain; background: #fff; }
.chat-image-loading, .chat-attachment-missing { display: flex; min-height: 72px; align-items: center; justify-content: center; font-size: 12px; }
.chat-file {
  display: flex; align-items: center; gap: 9px; width: min(280px, 72vw); padding: 9px 10px;
  border: 1px solid var(--card-line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; font-family: inherit;
}
.chat-file-icon { width: 30px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--blue-soft); color: var(--blue-ink); font-size: 12px; font-weight: 700; }
.chat-file > span:last-child { min-width: 0; }
.chat-file b { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.chat-file small { display: block; margin-top: 2px; color: var(--ink3); font-size: 10.5px; }
.chat-empty { margin: auto; padding: 36px 20px; text-align: center; color: var(--ink3); font-size: 12.5px; line-height: 1.65; }
.chat-empty b { display: block; margin-bottom: 5px; color: var(--ink2); font-size: 14px; }
.chat-empty button { margin-top: 12px; border: 0; background: none; color: var(--blue-ink); font: 600 12.5px/1.4 inherit; }
.chat-failed {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px;
  border: 1px solid #F0D2D2; border-radius: 9px; background: #FFF7F7; font-size: 11.5px;
}
.chat-failed div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-failed b { color: var(--red); }
.chat-failed span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.chat-failed button { flex: none; border: 0; background: none; color: var(--red); font: 600 12px/1.4 inherit; }
.chat-error { flex: none; margin: 0; padding: 7px var(--pad); border: 0; border-top: 1px solid #F0D2D2; background: #FFF7F7; color: #B73535; font: 12px/1.4 inherit; }
.chat-error[hidden], .chat-pending[hidden] { display: none; }
.chat-pending { flex: none; max-height: 142px; overflow-y: auto; padding: 8px var(--pad); border-top: 1px solid var(--line); background: #fff; }
.chat-pending-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; }
.chat-pending-file span { min-width: 0; display: flex; align-items: baseline; gap: 7px; }
.chat-pending-file b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.chat-pending-file small { flex: none; color: var(--ink3); font-size: 10.5px; }
.chat-pending-file button { width: 28px; height: 28px; flex: none; border: 0; background: none; color: var(--ink3); font-size: 19px; }
.chat-pending-total { padding-top: 4px; color: var(--ink3); font-size: 10.5px; }
.chat-pending-inquiry {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 6px; padding: 9px 42px 9px 11px; border: 1px solid #DDE5F1;
  border-radius: 9px; background: #F8FAFE;
}
.chat-pending-inquiry-label { color: var(--blue-ink); font-size: 10.5px; font-weight: 600; }
.chat-pending-inquiry b { font-size: 12.5px; line-height: 1.4; }
.chat-pending-inquiry small { color: var(--ink2); font-size: 10.5px; line-height: 1.4; }
.chat-pending-inquiry button {
  position: absolute; top: 5px; right: 5px; width: 30px; height: 30px;
  border: 0; background: none; color: var(--ink3); font-size: 19px;
}
.chat-composer {
  flex: none; display: flex; align-items: flex-end; gap: 7px; padding: 8px var(--pad);
  background: #fff; border-top: 1px solid var(--line);
}
.chat-composer textarea {
  flex: 1; min-width: 0; min-height: 40px; max-height: 112px; padding: 10px 11px; border-radius: 10px;
  background: #F5F6F8; border-color: transparent; font-size: 16px; line-height: 1.35; overflow-y: auto;
}
.chat-attach {
  width: 40px; height: 40px; flex: none; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink2); font: 400 22px/1 inherit;
}
.chat-send {
  height: 40px; min-width: 56px; flex: none; padding: 0 12px; border: 0; border-radius: 10px;
  background: #12161C; color: #fff; font: 600 13px/1 inherit;
}
.chat-send:disabled { opacity: .4; }

.chat-add-sheet .sheet-head { align-items: flex-start; }
.chat-add-sheet .sheet-head small {
  display: block; margin-top: 3px; color: var(--ink3); font-size: 11.5px; font-weight: 400;
}
.chat-add-sheet .sheet-body { display: flex; flex-direction: column; gap: 12px; }
.chat-add-heading { display: flex; align-items: baseline; justify-content: space-between; }
.chat-add-heading span { font-size: 13px; font-weight: 600; }
.chat-add-heading small { color: var(--ink3); font-size: 11px; }
.chat-inquiry-list { display: flex; flex-direction: column; gap: 7px; }
.chat-inquiry-option {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px;
  border: 1px solid var(--card-line); border-radius: 10px; background: #fff;
  color: var(--ink); text-align: left; font-family: inherit;
}
.chat-inquiry-option-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.chat-inquiry-option-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--ink3); font-size: 10.5px;
}
.chat-inquiry-option-top span {
  padding: 2px 6px; border-radius: 4px; background: #F2F4F7; color: var(--ink2); font-size: 10px;
}
.chat-inquiry-option b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; line-height: 1.4;
}
.chat-inquiry-option small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2);
  font-size: 11px; line-height: 1.4;
}
.chat-inquiry-option-arrow { flex: none; color: var(--ink3); font-size: 19px; }
.chat-inquiry-empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px; border: 1px dashed #D8DDE6; border-radius: 10px; background: #FAFBFC;
}
.chat-inquiry-empty b { font-size: 13px; }
.chat-inquiry-empty span { color: var(--ink3); font-size: 11.5px; }
.chat-inquiry-empty button {
  margin-top: 5px; border: 0; background: none; color: var(--blue-ink);
  font: 600 12px/1.4 inherit; padding: 5px 0;
}
.chat-add-file {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px;
  border: 0; border-top: 1px solid var(--line); background: transparent;
  color: var(--ink); text-align: left; font-family: inherit;
}
.chat-add-file-icon {
  width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: #F1F3F6; color: var(--ink2); font-size: 18px;
}
.chat-add-file > span:nth-child(2) { min-width: 0; flex: 1; }
.chat-add-file b { display: block; font-size: 12.5px; }
.chat-add-file small { display: block; margin-top: 2px; color: var(--ink3); font-size: 10.5px; }
.chat-add-file > span:last-child { flex: none; color: var(--ink3); font-size: 19px; }

.chat-workspace { flex: 1; min-height: 0; display: flex; }
.chat-column { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat-recent-strip {
  flex: none; min-width: 0; padding: 9px var(--pad) 10px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.chat-recent-strip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.chat-recent-strip-head span { font-size: 12px; font-weight: 600; }
.chat-recent-strip-head button,
.chat-recent-head button {
  border: 0; background: none; color: var(--ink3); font: 500 11.5px/1.4 inherit; padding: 0;
}
.chat-recent-track {
  display: flex; gap: 8px; overflow-x: auto; padding: 1px 0;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.chat-recent-track::-webkit-scrollbar { display: none; }
.chat-recent-track .chat-recent-item { flex: 0 0 230px; width: 230px; }
.chat-recent-rail { display: none; }
.chat-recent-head {
  flex: none; display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 20px 18px 14px;
}
.chat-recent-head b { display: block; font-size: 16px; line-height: 1.3; }
.chat-recent-head span { display: block; margin-top: 3px; color: var(--ink3); font-size: 11.5px; }
.chat-recent-head button { margin-top: 2px; flex: none; }
.chat-recent-list {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column;
  gap: 8px; padding: 0 18px 18px;
}
.chat-recent-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main rate" "meta rate"; column-gap: 12px; row-gap: 6px;
  width: 100%; min-height: 66px; padding: 11px 12px;
  border: 1px solid var(--card-line); border-radius: 9px; background: #fff;
  color: var(--ink); text-align: left; font-family: inherit;
}
.chat-recent-item-main {
  grid-area: main; min-width: 0; display: flex; align-items: center; gap: 7px;
}
.chat-recent-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 600; line-height: 1.4;
}
.chat-recent-status {
  flex: none; padding: 2px 5px; border-radius: 4px; background: #F1F3F6;
  color: var(--ink2); font-size: 11px; line-height: 1.35;
}
.chat-recent-status.active { background: #ECF8F1; color: #17633F; }
.chat-recent-status.accepted { background: var(--blue-soft); color: var(--blue-ink); }
.chat-recent-status.expired { background: #F2F3F5; color: var(--ink3); }
.chat-recent-rate {
  grid-area: rate; align-self: center; color: var(--blue-ink);
  font-size: 19px; font-weight: 700; line-height: 1; letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}
.chat-recent-rate small { margin-left: 1px; font-size: 12px; font-weight: 600; }
.chat-recent-meta {
  grid-area: meta; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink3); font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums;
}
.chat-recent-empty {
  margin: 0 18px; padding: 16px; border: 1px dashed #D8DDE6; border-radius: 9px;
  background: #FAFBFC;
}
.chat-recent-strip .chat-recent-empty { margin: 0; padding: 10px 12px; }
.chat-recent-empty b { display: block; font-size: 13px; }
.chat-recent-empty span { display: block; margin-top: 3px; color: var(--ink3); font-size: 11.5px; line-height: 1.5; }
.chat-recent-empty button {
  margin-top: 7px; padding: 0; border: 0; background: none;
  color: var(--blue-ink); font: 600 12px/1.4 inherit;
}
.q.recent-quote-target { border-color: #9EB8F5; background: #F8FAFF; }

@media (min-width: 960px) {
  .chat-workspace {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  }
  .chat-recent-strip { display: none; }
  .chat-recent-rail {
    display: flex; min-width: 0; min-height: 0; flex-direction: column;
    background: #fff; border-left: 1px solid var(--line);
  }
}

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  background: rgba(20, 24, 31, .9); color: #fff; font-size: 13px; padding: 10px 18px;
  border-radius: 10px; z-index: 90; opacity: 0; transition: all .2s; pointer-events: none; max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* 风险揭示书必须完整可见：之前 max-height 截断在「请确认您」，
   手机上没人知道框里还能滚，等于没揭示。 */
.risk-box { font-size: 12px; color: var(--ink2); line-height: 1.7; background: #FAFBFC; border: 1px solid #EEF0F4; border-radius: 10px; padding: 12px; }
.check-line { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
.check-line input { width: 18px; height: 18px; flex: none; margin-top: 1px; accent-color: var(--blue); }

/* ---------- 持仓 ---------- */
.up { color: #E5484D; }
.down { color: #0FA968; }

.pos-summary .psum { display: flex; gap: 10px; }
.pos-summary .psum > div { flex: 1; min-width: 0; }
.pos-summary .k { font-size: 11.5px; color: var(--ink3); margin-bottom: 5px; }
.pos-summary .v { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }

.seg { display: flex; gap: 6px; background: #fff; border-radius: var(--radius); padding: 5px; border: 1px solid var(--card-line); }
.seg .s { flex: 1; border: 0; background: none; font-family: inherit; font-size: 12.5px; color: var(--ink2); padding: 9px 4px; border-radius: 9px; }
.seg .s.on { background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; }

.pos { background: #fff; border-radius: var(--radius); padding: 14px 15px; border: 1px solid var(--card-line); }
.pos-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pos-head { min-width: 0; flex: 1; }
.pos-name { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pos-sub { font-size: 12px; color: var(--ink3); margin-top: 4px; }
.pos-pnl { text-align: right; flex: none; }
.pos-pnl .v { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.pos-pnl .k { font-size: 11px; color: var(--ink3); margin-top: 3px; }

.pos-metrics { display: flex; gap: 8px; margin-top: 11px; background: #F7F8FA; border-radius: 10px; padding: 9px 10px; }
.pos-metrics > div { flex: 1; min-width: 0; }
.pos-metrics span { display: block; font-size: 11px; color: var(--ink3); margin-bottom: 3px; }
.pos-metrics b { font-size: 12.5px; font-weight: 600; }

.pos-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--ink3); }

.appbar .back { background: none; border: 0; font-family: inherit; font-size: 14px; color: var(--ink2); padding: 0; }
.appbar .back + .t { flex: 1; text-align: center; }

.picker { width: 100%; margin-top: 10px; background: #FAFBFC; border: 1px solid #E9ECF2; border-radius: 10px; padding: 12px; font-family: inherit; display: flex; align-items: center; gap: 8px; text-align: left; }
.picker .pk-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.picker .pk-code { font-size: 12px; color: var(--ink3); }
.picker .pk-empty { font-size: 13px; color: var(--ink3); flex: 1; }
.picker .pk-arrow { margin-left: auto; color: var(--ink3); font-size: 16px; }

.kv { margin-top: 8px; }
.kv-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #F5F6F9; }
.kv-row:last-child { border-bottom: 0; }
.kv-row .kk { font-size: 12.5px; color: var(--ink3); flex: none; }
.kv-row .vv { font-size: 13px; text-align: right; word-break: break-all; }

.pdetail-pnl { display: flex; gap: 24px; margin-top: 12px; }
.pdetail-pnl .v { font-size: 24px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.pdetail-pnl .k { font-size: 11px; color: var(--ink3); margin-top: 5px; }

.timeline { margin-top: 10px; }
.tl-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.tl-head span { font-size: 12px; color: var(--ink3); }
.tl-body { display: flex; gap: 14px; margin-top: 9px; }
.tl-body > div { flex: 1; min-width: 0; }
.tl-body b { display: block; font-size: 13px; font-weight: 600; }
.tl-body span { font-size: 11px; color: var(--ink3); }

.pact-bar { flex: none; display: flex; gap: 10px; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.pact { flex: 1; height: 44px; border-radius: 11px; border: 1px solid #E3E7EE; background: #fff; font-family: inherit; font-size: 14.5px; color: var(--ink2); }
.pact.strong { background: #12161C; color: #fff; border: 0; font-weight: 600; }

/* Native WebViews expose safe-area values when drawing below system UI. */
.native-app #app { padding-top: env(safe-area-inset-top, 0px); }
.native-app .appbar { flex-shrink: 0; }
