/* 需求 62：画线工具栏分组、分组弹出、文字输入框、盈亏比框旁的两个按钮（docs/65）。
   工具栏本身的样式在 style.css（.draw-bar），这里只加新的部分。 */

/* 分组按钮：图标是组里最近用过的工具，右下角一个小三角表示能点开 */
.draw-bar .db-grp { position: relative; }
.draw-bar .db-grp .db-more { position: absolute; right: 2px; bottom: 2px; width: 0; height: 0; border-left: 4px solid transparent; border-bottom: 4px solid currentColor; opacity: .7; }
.draw-bar .db-grp.open:not(.on) { background: var(--sh-hover, #2a3040); color: var(--sh-text-hi, #fff); }

/* 分组弹出：贴在工具栏右边，一行一个工具（图标 + 名字 + 快捷键） */
.draw-bar .db-fly { position: absolute; left: calc(100% + 4px); top: 0; z-index: 6; display: flex; flex-direction: column; gap: 2px; padding: 3px; min-width: 150px; background: var(--sh-float, rgba(23, 27, 36, .97)); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 8px var(--sh-shadow, rgba(0, 0, 0, .35)); }
.draw-bar .db-fly button { width: auto; height: 30px; justify-content: flex-start; gap: 8px; padding: 0 8px; white-space: nowrap; }
.draw-bar .db-fly button span { flex: 1; text-align: left; font-size: 12px; }
.draw-bar .db-fly kbd { font: 11px/1 ui-monospace, Consolas, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px; }
.draw-bar .db-fly button.on kbd { color: var(--sh-on-fill, #fff); border-color: var(--sh-on-fill-dim, rgba(255, 255, 255, .5)); }

/* 文字输入框：浮在落点附近（落点本身已经按价格 + 时间记下了，框挪动不影响落点） */
.db-text-edit { position: absolute; z-index: 7; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; max-width: calc(100% - 8px); background: var(--sh-float, rgba(23, 27, 36, .97)); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 8px var(--sh-shadow, rgba(0, 0, 0, .35)); }
.db-text-edit input { width: 220px; max-width: 56vw; }
.db-text-edit button { padding: 2px 8px; }
.db-text-cnt { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.db-text-cnt.full { color: var(--warn); }
.db-text-warn { flex-basis: 100%; font-size: 11px; color: var(--warn); }

/* 盈亏比框选中时，框右下角的两个按钮 */
.db-rr-pop { position: absolute; z-index: 6; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 4px; max-width: 190px; background: var(--sh-float, rgba(23, 27, 36, .95)); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 8px var(--sh-shadow, rgba(0, 0, 0, .35)); }
.db-rr-pop button { white-space: nowrap; }
.db-rr-note { font-size: 11px; line-height: 1.35; color: var(--muted); }

/* 「填入下单区」之后，该点的那个买卖 / 挂单按钮闪几下 */
.rr-hint { box-shadow: 0 0 0 2px var(--warn); animation: rr-hint-pulse 1s ease-in-out 3; }
@keyframes rr-hint-pulse { 50% { box-shadow: 0 0 0 4px var(--sh-warn-line, rgba(240, 180, 41, .35)); } }

@media (max-width: 760px) {
  .draw-bar .db-fly button { width: auto; height: 44px; }
  .db-text-edit input { font-size: 16px; }  /* iOS 小于 16px 会自动放大页面 */
  .db-text-edit button, .db-rr-pop button { min-height: 40px; }
}
