/* ==========================================================================
   components.css — 表格/文字/标签/按钮等通用组件样式
   --------------------------------------------------------------------------
   含对 Arco 组件的必要覆盖(表格单元格紧凑化等)，以及涨跌色、呼吸灯动画。
   ========================================================================== */

/* ── 涨跌文字色 ───────────────────────────────────────────── */
.text-red {
    color: var(--c-up) !important;
    font-weight: bold;
}

.text-green {
    color: var(--c-down) !important;
    font-weight: bold;
}

/* ── 股票代码/名称 ────────────────────────────────────────── */
.stock-item {
    font-weight: bold;
    font-size: var(--fs-base);
    color: var(--c-text);
    display: inline-flex;
}

.stock-code {
    color: var(--c-text-dim);
    font-size: var(--fs-md);
}

.sub-text {
    font-size: var(--fs-sm);
    color: var(--c-text-dim);
}

/* ── 命中信号的表格行高亮 ─────────────────────────────────── */
.row-success,
.row-success td {
    background-color: var(--c-up-bg) !important;
}

/* ── Arco 表格紧凑化覆盖 ─────────────────────────────────── */
.arco-table-th .arco-table-cell {
    padding: var(--sp-sm) 5px !important;
}

.arco-table-td .arco-table-cell {
    padding: 5px 5px !important;
}

.arco-table-sorter {
    margin-left: 0;
}

.arco-table-cell-fixed-expand .arco-table-td-content {
    font-size: var(--fs-base);
    margin-left: 80px;
}

/* 隐藏默认展开按钮(改由自定义列触发) */
.arco-table .arco-table-expand-btn {
    display: none !important;
}

/* ── 呼吸灯动画 (监控预警按钮) ───────────────────────────── */
@keyframes breathing-red {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 63, 63, 0.7);
        transform: scale(1);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 63, 63, 0);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 63, 63, 0);
        transform: scale(1);
    }
}

@keyframes breathing-green {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 180, 42, 0.7);
        transform: scale(1);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 180, 42, 0);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 180, 42, 0);
        transform: scale(1);
    }
}

/* 突破/加仓：绿色呼吸 */
.btn-breathing-add {
    animation: breathing-green 1.5s infinite;
    background-color: var(--c-down) !important;
    color: #fff !important;
    border-color: var(--c-down) !important;
}

/* 破位/止损：红色呼吸 */
.btn-breathing-cut {
    animation: breathing-red 1.5s infinite;
    background-color: var(--c-up) !important;
    color: #fff !important;
    border-color: var(--c-up) !important;
}

/* ── 图表容器 (新增) ─────────────────────────────────────── */
.chart-box {
    width: 100%;
    background: var(--c-panel);
    border-radius: var(--r-md);
}

.chart-box--kline {
    height: 460px;
}

.chart-box--intraday {
    height: 360px;
}

.chart-box--flow {
    height: 260px;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--c-text-dim);
    font-size: var(--fs-base);
}

/* 图表工具栏 */
.chart-toolbar {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-sm);
    flex-wrap: wrap;
}

/* Scoped chart workspace; existing page and table styles stay unchanged. */
.wt-chart-panel { max-height: 78vh; overflow: auto; color: #1d2129; letter-spacing: 0; }
.wt-chart-section { min-width: 0; padding: 0 0 10px; }
.wt-chart-section + .wt-chart-section { padding-top: 12px; border-top: 1px solid #e5e6eb; }
.wt-chart-heading { display: flex; align-items: center; justify-content: space-between;
    gap: 8px 16px; flex-wrap: wrap; padding: 0 4px 8px; }
.wt-chart-heading h3 { font-size: 14px; margin: 0; font-weight: 600; }
.wt-chart-heading h3 span, .wt-chart-plot h4 span { font-size: 11px; color: #4e5969; font-weight: 400; margin-left: 8px; }
.wt-chart-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wt-chart-controls .arco-btn { flex: 0 0 28px; }
.wt-chart-canvas { width: 100%; min-width: 0; }
.wt-chart-kline { height: 300px; }
.wt-chart-minute { height: 280px; }
.wt-chart-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.wt-chart-plot { min-width: 0; }
.wt-chart-plot + .wt-chart-plot { border-left: 1px solid #e5e6eb; padding-left: 16px; }
.wt-chart-plot h4 { margin: 0 4px 6px; font-size: 12px; font-weight: 600; }
.wt-chart-panel .arco-alert { margin-bottom: 8px; }
@media (max-width: 900px) {
    .wt-chart-pair { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .wt-chart-plot + .wt-chart-plot { border-left: 0; border-top: 1px solid #e5e6eb; padding: 10px 0 0; }
}
@media (max-width: 600px) {
    .wt-chart-heading { align-items: flex-start; }
    .wt-chart-controls { gap: 6px; }
    .wt-chart-heading h3 span { display: inline-block; }
    .wt-chart-kline { height: 270px; }
    .wt-chart-minute { height: 290px; }
    .wt-chart-plot h4 span { display: block; margin: 3px 0 0; }
}
