* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: #0b0e14; color: #d1d4dc; font-family: "Microsoft YaHei", Consolas, monospace; overflow: hidden; font-size: 12px; }

/* 顶部导航与画线工具栏 */
.top-bar { width: 100%; height: 5.5%; min-height: 36px; background: #161a24; border-bottom: 1px solid #2a2e39; display: flex; align-items: center; padding: 0 1%; gap: 0.8%; overflow-x: auto; white-space: nowrap; }
.brand { color: #f5b041; font-weight: bold; font-size: 14px; margin-right: 0.5%; }
.search-box { display: flex; align-items: center; background: #0b0e14; border: 1px solid #363c4e; border-radius: 3px; padding: 2px 6px; }
.search-box input { background: transparent; border: none; color: #fff; width: 78px; outline: none; font-size: 12px; }
.search-box button { background: #2962ff; color: #fff; border: none; border-radius: 2px; padding: 2px 8px; cursor: pointer; font-size: 11px; }

.period-group, .tool-group, .idx-group { display: flex; align-items: center; gap: 4px; border-left: 1px solid #2a2e39; padding-left: 0.8%; }
.btn-item { background: transparent; border: 1px solid transparent; color: #9598a1; padding: 3px 8px; border-radius: 3px; cursor: pointer; transition: all 0.15s; font-size: 12px; }
.btn-item:hover { color: #fff; background: #2a2e39; }
.btn-item.active { color: #f5b041; border-color: #f5b041; background: rgba(245, 176, 65, 0.12); font-weight: bold; }

/* 顶部单字指标开关（智/结/多） */
.btn-idx { padding: 3px 7px; font-weight: bold; color: #aeb4c0; }
.btn-idx.active { color: #ff00ff; border-color: #ff00ff; background: rgba(255, 0, 255, 0.14); }

/* PC客户端同款：折线+实心圆点画线图标按钮 */
.btn-tool-icon { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; padding: 0; color: #aeb4c0; position: relative; }
.btn-tool-icon:hover { color: #ffffff; background: #252b38; }
.btn-tool-icon.active { color: #ff00ff; border-color: #ff00ff; background: rgba(255, 0, 255, 0.16); }

/* 全局悬浮提示胶囊 */
.tool-tooltip { position: fixed; background: rgba(22, 26, 36, 0.96); color: #f5b041; border: 1px solid #363c4e; padding: 3px 8px; border-radius: 3px; font-size: 11px; pointer-events: none; z-index: 9999; display: none; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }

/* 主体工作区 */
.workspace { width: 100%; height: 91%; display: flex; }
.chart-area { width: 78%; height: 100%; position: relative; border-right: 1px solid #2a2e39; display: flex; flex-direction: column; }
.chart-info-bar { width: 100%; height: 3.5%; min-height: 24px; padding: 0 1%; display: flex; align-items: center; gap: 12px; background: #0f131a; border-bottom: 1px solid #1e222d; font-size: 11.5px; overflow: hidden; white-space: nowrap; }
.canvas-wrap { width: 100%; height: 96.5%; position: relative; cursor: crosshair; }
canvas { display: block; width: 100%; height: 100%; }
.draw-tip { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background: rgba(41, 98, 255, 0.92); color: #fff; padding: 4px 12px; border-radius: 4px; font-size: 12px; display: none; pointer-events: none; z-index: 20; }

/* 右侧五档盘口与明细 */
.side-panel { width: 22%; height: 100%; background: #11151e; display: flex; flex-direction: column; overflow-y: auto; }
.stock-header { padding: 8px 10px; border-bottom: 1px solid #2a2e39; display: flex; justify-content: space-between; align-items: baseline; }
.stock-title { font-size: 15px; font-weight: bold; color: #f5b041; }
.stock-code { color: #8c98a4; font-size: 12px; margin-left: 4px; }
.price-main { font-size: 16px; font-weight: bold; }
.up { color: #ff3232; }
.down { color: #00e676; }

.order-book { padding: 6px 10px; border-bottom: 1px solid #2a2e39; }
.ob-row { display: flex; justify-content: space-between; line-height: 1.65; font-size: 12px; }
.ob-label { color: #8c98a4; width: 28%; }
.ob-price { width: 36%; text-align: right; font-weight: bold; }
.ob-vol { width: 36%; text-align: right; color: #d1d4dc; }
.ob-divider { border-top: 1px dashed #2a2e39; margin: 4px 0; }

.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 8px 10px; border-bottom: 1px solid #2a2e39; font-size: 11.5px; }
.m-item { display: flex; justify-content: space-between; }
.m-item span:first-child { color: #8c98a4; }

.ticks-box { flex: 1; padding: 6px 10px; overflow-y: auto; }
.ticks-title { color: #8c98a4; margin-bottom: 4px; font-size: 11px; }

/* 底部状态栏 */
.bottom-bar { width: 100%; height: 3.5%; min-height: 24px; background: #161a24; border-top: 1px solid #2a2e39; display: flex; align-items: center; padding: 0 1%; gap: 2%; font-size: 11.5px; color: #9598a1; white-space: nowrap; overflow: hidden; }

/* 手机端自适应 */
@media (max-width: 768px) {
  .workspace { flex-direction: column; height: 91%; }
  .chart-area { width: 100%; height: 66%; border-right: none; border-bottom: 1px solid #2a2e39; }
  .side-panel { width: 100%; height: 34%; }
  .metrics-grid, .ticks-box { display: none; }
}
