/* 极简双页指示器 (极简主义 HUD，仅两颗极小圆点，位于屏幕底端正中) */
.page-dots-container {
  display: none !important;
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 10000;
  pointer-events: auto;
  cursor: pointer;
  padding: 6px 12px;
}
.page-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: all 0.2s ease;
}
.page-dot.active {
  background: #ffffff;
  transform: scale(1.3);
}
#live-trading-view.light-theme .page-dot {
  background: rgba(0, 0, 0, 0.22);
}
#live-trading-view.light-theme .page-dot.active {
  background: #111111;
}

/* ============================================================
   KLineReview - 原版 2x2 极清田字格专属样式
   严格保证：零横纵坐标轴、零时间价格数字、纯净黑白K线与EMA20
   ============================================================ */

#live-trading-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5000;
  background-color: #ffffff;
  overflow: hidden !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, monospace;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-touch-callout: none !important;
}



/* 纯自研 Canvas 渲染架构，零外部图表库与水印 */
#global-countdown {
  position: fixed;
  top: 6px;
  right: 14px;
  z-index: 10000;
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0.5px;
  pointer-events: auto;
  cursor: pointer;
  background: #ffffff;
  padding: 0 4px;
  line-height: 1;
}

#global-countdown.is-offline {
  color: #ff3b30 !important;
  font-weight: 700 !important;
  background: rgba(255, 59, 48, 0.1) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}

/* 全屏单品种图表容器 (零 2x2 网格，100% 占满视口) */
#grid-container {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #000000;
  touch-action: none !important;
}

/* 单个图表卡片直接全屏铺满 */
.chart-box {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  background-color: #000000;
  contain: strict;
  pointer-events: auto !important;
  touch-action: none !important;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  border: none !important;
}

.chart-box.is-expanded {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border: none !important;
}

.chart-box.is-expanded .symbol-overlay {
  font-size: 18px !important;
  top: 10px !important;
  left: 14px !important;
}

/* 左列加右黑边框 (十字中轴线) */
.chart-box:nth-child(odd) {
  border-right: 1px solid #000000;
}

/* 前 1 行加下底边框 (十字水平线) */
.chart-box:nth-child(-n+2) {
  border-bottom: 1px solid #000000;
}

/* 单个图表 Canvas 绘制容器 (严格限定在 2x2 实盘卡位格子内，杜绝样式污染全局主图画布) */
.chart-box .chart-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  touch-action: none !important;
}

/* 左上角品种名称 */
.symbol-overlay {
  position: absolute;
  top: 6px;
  left: 10px;
  z-index: 999;
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0.5px;
  pointer-events: none;
  background: #ffffff;
  padding: 0 2px;
}

/* 左下角持仓/挂单极简单个字母小标识 (P: 挂单, H: 持仓) */
.slot-badge {
  position: absolute;
  bottom: 6px;
  left: 8px;
  z-index: 999;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  border-radius: 3px;
  display: none;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.slot-badge.badge-pending {
  display: block;
  background: #000000;
  color: #ffffff;
}
.slot-badge.badge-holding {
  display: block;
  background: #089981;
  color: #ffffff;
}

/* ============================================================
   MT5 iPad 风格：极简舒适 1px 细虚线与左侧药丸标签
   ============================================================ */
#order-overlay-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10001;
  overflow: hidden;
}

.draggable-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: auto;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: transparent !important;
  transition: opacity 0.15s ease;
}

/* 扩大 iPad 触摸命中区域 (48px 纵向感知条，无论手指轻点还是拖拉都极易响应) */
.draggable-line::before {
  content: '';
  position: absolute;
  top: -24px;
  bottom: -24px;
  left: 0;
  right: 0;
}

/* 挂单线 (Buy Limit / Sell Limit): MT5 iPad 经典细腻蓝虚线 */
.draggable-line.entry-line {
  height: 1px;
  background: transparent !important;
  border-top: 1px dashed rgba(74, 144, 226, 0.72);
}

/* 持仓单: MT5 iPad 经典细实线 */
.draggable-line.entry-line.holding-line {
  height: 1px;
  background: transparent !important;
  border-top: 1px solid rgba(74, 144, 226, 0.85);
}

/* 止损线: MT5 iPad 经典细腻红虚线 */
.draggable-line.sl-line {
  height: 1px;
  background: transparent !important;
  border-top: 1px dashed rgba(235, 87, 87, 0.75);
}

/* 止盈线: MT5 iPad 经典细腻绿虚线 */
.draggable-line.tp-line {
  height: 1px;
  background: transparent !important;
  border-top: 1px dashed rgba(39, 174, 96, 0.75);
}

/* 拖拽悬停视觉反馈 */
.draggable-line:hover,
.draggable-line:active {
  opacity: 1.0;
}
.draggable-line.entry-line:hover,
.draggable-line.entry-line:active {
  border-top-color: rgba(100, 165, 255, 0.95);
}
.draggable-line.sl-line:hover,
.draggable-line.sl-line:active {
  border-top-color: rgba(255, 95, 95, 0.95);
}
.draggable-line.tp-line:hover,
.draggable-line.tp-line:active {
  border-top-color: rgba(50, 205, 125, 0.95);
}

/* 标签药丸: MT5 iPad 经典停靠左侧，彻底让出中央蜡烛走势与右侧实时报价 */
.line-handle-tag {
  position: absolute;
  left: 16px;
  top: -9px;
  height: 18px;
  padding: 0 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Segoe UI", monospace;
  letter-spacing: 0.2px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.line-handle-tag:active {
  cursor: grabbing;
}

/* 挂单 / 入场标签: MT5 低饱和蓝黑半透药丸 */
.entry-line .line-handle-tag {
  background: rgba(14, 26, 48, 0.88);
  border: 1px solid rgba(74, 144, 226, 0.55);
  color: #9ec5fe;
}

/* 止损标签: MT5 低饱和暗红半透药丸 */
.sl-line .line-handle-tag {
  background: rgba(45, 14, 18, 0.88);
  border: 1px solid rgba(235, 87, 87, 0.55);
  color: #ff9e9e;
}

/* 止盈标签: MT5 低饱和暗绿半透药丸 */
.tp-line .line-handle-tag {
  background: rgba(10, 36, 22, 0.88);
  border: 1px solid rgba(39, 174, 96, 0.55);
  color: #8ce6b0;
}

/* 持仓入场线标签 */
.draggable-line.holding-line .line-handle-tag {
  background: rgba(14, 30, 56, 0.92);
  border: 1px solid rgba(74, 144, 226, 0.7);
  color: #b8d6ff;
  cursor: default !important;
}

/* 极简取消小按钮: MT5 风格微型 x，不抢视觉焦点 */
.btn-line-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  margin-left: 3px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.55;
  color: inherit;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  pointer-events: auto;
}

.btn-line-cancel:hover,
.btn-line-cancel:active {
  opacity: 1.0;
  background: rgba(255, 255, 255, 0.15);
  color: #ff5252;
}

/* 左下角订单气泡 */
#order-bubble {
  position: fixed;
  bottom: 24px;
  left: 20px;
  z-index: 10005;
  background: rgba(18, 18, 18, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;
  width: 290px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, sans-serif;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#order-bubble.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
}
.bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.bubble-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.bubble-badge:hover {
  filter: brightness(1.2);
}
.bubble-badge:active {
  transform: scale(0.94);
}
.bubble-badge.buy {
  background: #089981;
  color: #ffffff;
}
.bubble-badge.sell {
  background: #F23645;
  color: #ffffff;
}
.bubble-sym {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}
.bubble-risk-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.risk-chip {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  color: #aaaaaa;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}
.risk-chip.active {
  background: #ffffff;
  color: #000000;
  font-weight: 800;
}
.bubble-stats {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: #cccccc;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
}
.stat-row b {
  color: #ffffff;
  font-weight: 700;
}
.bubble-actions {
  display: flex;
  gap: 8px;
}
.btn-submit-order {
  flex: 1;
  padding: 9px 0;
  background: #2962FF;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-submit-order:active {
  background: #1b4cd6;
}
.btn-cancel-draft {
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* 快捷悬浮提示 Toast */
#order-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: #000000;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  z-index: 10009;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
#order-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 周末休市全屏极简看板 (周六/周日自动呈现) */
#weekend-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0b0f19;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none !important;
  touch-action: none !important;
}

#weekend-screen.weekend-hidden {
  display: none !important;
}

.weekend-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
}

.weekend-day {
  font-size: 112px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 4px;
  color: #f8fafc;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", -apple-system, BlinkMacSystemFont, sans-serif;
}

.weekend-clock {
  font-size: 68px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 2px;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, monospace;
}

.weekend-date {
  font-size: 22px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 1px;
}

.weekend-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.weekend-badge {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background-color: #2563eb;
  padding: 5px 14px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.weekend-reopen-tip {
  font-size: 15px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.5px;
}

/* ============================================================
   黑白UI与极简纯黑夜间模式 (自动切换，零多余按钮)
   ============================================================ */
@media (prefers-color-scheme: dark) {
  #live-trading-view:not(.theme-light) {
    background-color: #000000;
  }
  #live-trading-view:not(.theme-light) #grid-container {
    background-color: #000000;
  }
  #live-trading-view:not(.theme-light) .chart-box {
    background-color: #000000;
  }
  #live-trading-view:not(.theme-light) .chart-box:nth-child(odd) {
    border-right: 1px solid #1c1c1c;
  }
  #live-trading-view:not(.theme-light) .chart-box:nth-child(-n+2) {
    border-bottom: 1px solid #1c1c1c;
  }
  #live-trading-view:not(.theme-light) #global-countdown {
    color: #ffffff;
    background: #000000;
  }
  #live-trading-view:not(.theme-light) .symbol-overlay {
    color: #ffffff;
    background: #000000;
  }
  #live-trading-view:not(.theme-light) .slot-badge.badge-pending {
    background: #ffffff;
    color: #000000;
  }
  #live-trading-view:not(.theme-light) .slot-badge.badge-holding {
    background: #0070f3;
    color: #ffffff;
  }
}

#live-trading-view.theme-dark {
  background-color: #000000;
}
#live-trading-view.theme-dark #grid-container {
  background-color: #000000;
}
#live-trading-view.theme-dark .chart-box {
  background-color: #000000;
}
#live-trading-view.theme-dark .chart-box:nth-child(odd) {
  border-right: 1px solid #1c1c1c;
}
#live-trading-view.theme-dark .chart-box:nth-child(-n+2) {
  border-bottom: 1px solid #1c1c1c;
}
#live-trading-view.theme-dark #global-countdown {
  color: #ffffff;
  background: #000000;
}
#live-trading-view.theme-dark .symbol-overlay {
  color: #ffffff;
  background: #000000;
}
#live-trading-view.theme-dark .slot-badge.badge-pending {
  background: #ffffff;
  color: #000000;
}
#live-trading-view.theme-dark .slot-badge.badge-holding {
  background: #0070f3;
  color: #ffffff;
}
#live-trading-view.theme-light {
  background-color: #ffffff;
}
#live-trading-view.theme-light #grid-container {
  background-color: #ffffff;
}
#live-trading-view.theme-light .chart-box {
  background-color: #ffffff;
}
#live-trading-view.theme-light .chart-box:nth-child(odd) {
  border-right: 1px solid #000000;
}
#live-trading-view.theme-light .chart-box:nth-child(-n+2) {
  border-bottom: 1px solid #000000;
}
#live-trading-view.theme-light #global-countdown {
  color: #000000;
  background: #ffffff;
}
#live-trading-view.theme-light .symbol-overlay {
  color: #000000;
  background: #ffffff;
}
#live-trading-view.theme-light .slot-badge.badge-pending {
  background: #000000;
  color: #ffffff;
}
#live-trading-view.theme-light .slot-badge.badge-holding {
  background: #089981;
  color: #ffffff;
}
#live-trading-view.theme-light #weekend-screen {
  background-color: #ffffff;
}
#live-trading-view.theme-light .weekend-day {
  color: #0f172a;
}
#live-trading-view.theme-light .weekend-clock {
  color: #0f172a;
}
#live-trading-view.theme-light .weekend-date {
  color: #475569;
}
#live-trading-view.theme-light .weekend-badge {
  background-color: #0f172a;
  color: #ffffff;
}
#live-trading-view.theme-light .weekend-reopen-tip {
  color: #64748b;
}


/* ============================================================
   单品种放大时全屏 50% 左右隐藏双击感应区与浮动提示
   ============================================================ */
.expand-zone {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 100;
  background: transparent;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  pointer-events: none;
}

#live-trading-view.has-expanded .expand-zone {
  display: block;
}

.expand-zone-left {
  left: 0;
}

.expand-zone-right {
  right: 0;
}



.badge-tf-1m {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.badge-tf-10m,
.badge-tf-5m,
.badge-tf-15m {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}
