/* ============================================================
   kline.css - K 线图弹窗样式（V3.0）
   ============================================================ */

.kline-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: kline-fadein 0.2s ease;
}
@keyframes kline-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}
.kline-panel {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    color: #eaeaea;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.kline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.kline-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.kline-code {
    font-size: 18px;
    font-weight: bold;
    color: #f1c40f;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
.kline-tier {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #fff;
}
.kline-tier.tier-stable { background: #3498db; }
.kline-tier.tier-growth { background: #16a085; }
.kline-tier.tier-tech   { background: #9b59b6; }
.kline-tier.tier-wild   { background: #e74c3c; }
.kline-tier.tier-legacy { background: #7f8c8d; }
.kline-price {
    font-size: 22px;
    font-weight: bold;
    font-family: "SimSun", "宋体", serif;
}
.kline-price.up   { color: #E74C3C; }  /* 涨：红 */
.kline-price.down { color: #2ECC71; }  /* 跌：绿 */
.kline-close {
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}
.kline-close:hover { color: #fff; }
.kline-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.kline-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.kline-info-label {
    font-size: 11px;
    color: #999;
    font-family: "SimSun", "宋体", serif;
}
.kline-info-value {
    font-size: 14px;
    font-weight: bold;
    font-family: "SimSun", "宋体", serif;
}
.kline-info-value.up   { color: #E74C3C; }
.kline-info-value.down { color: #2ECC71; }
.kline-canvas-wrap {
    position: relative;
    width: 100%;
    padding: 16px 0;
    background: rgba(0, 0, 0, 0.2);
    /* V3.6.1.3:锁住画布范围框,防止浏览器原生 pinch-to-zoom 缩放整个手机页面 */
    /*   - 用户双指在画布上滑动时,只缩放 K 线图,不缩放浏览器页面 */
    /*   - touch-action: manipulation 允许 JS 处理 touch(单指 hover/双指缩放),禁用浏览器默认 pinch */
    touch-action: manipulation;
}
/* V3.0: 日/周/月切换 + 数据范围 */
.kline-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.kline-view-switch {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 2px;
}
.kline-view-btn {
    background: transparent;
    color: #999;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-family: "SimSun", "宋体", serif;
    cursor: pointer;
    transition: all 0.2s;
}
.kline-view-btn:hover { color: #fff; }
.kline-view-btn.active {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: #fff;
    font-weight: bold;
}
.kline-range {
    font-size: 11px;
    color: #888;
    font-family: "SimSun", "宋体", serif;
    text-align: center;
    padding: 4px 0 8px;
}
/* V3.2.7.9: 范围选择按钮（1月/3月/6月/1年） */
.kline-range-switch {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 2px;
}
.kline-range-btn {
    background: transparent;
    color: #999;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-family: "SimSun", "宋体", serif;
    cursor: pointer;
    transition: all 0.2s;
}
.kline-range-btn:hover { color: #fff; }
.kline-range-btn.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    font-weight: bold;
}
/* V3.2.7.9: 顶部常驻 OHLC 显示栏（开/收/高/低） */
.kline-ohlc-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1px;
    background: rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.ohlc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background: rgba(0, 0, 0, 0.25);
}
.ohlc-label {
    font-size: 11px;
    color: #888;
    font-family: "SimSun", "宋体", serif;
    margin-bottom: 2px;
}
.ohlc-value {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    font-family: "Consolas", "Monaco", monospace;
}
.ohlc-value.up   { color: #E74C3C; }  /* 涨：红 */
.ohlc-value.down { color: #2ECC71; }  /* 跌：绿 */
#kline-canvas {
    display: block;
    width: 100%;
    height: 300px;
    cursor: crosshair;
}
.kline-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 11px;
    min-width: 110px;
    z-index: 10;
    pointer-events: none;
    font-family: "SimSun", "宋体", serif;
}
.kline-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    line-height: 1.5;
}
.kline-tooltip-row span:first-child { color: #999; }
.kline-tooltip-row .up   { color: #E74C3C; font-weight: bold; }
.kline-tooltip-row .down { color: #2ECC71; font-weight: bold; }
.kline-tip {
    padding: 10px 20px 16px;
    font-size: 11px;
    color: #999;
    text-align: center;
    font-family: "SimSun", "宋体", serif;
}
