/* ================================================================
 * nexus.css — 中枢时间线: 顶栏入口 + 移动端抽屉 / 电脑端对话框
 *   配色沿用 base.css 的浅色变量; z-index 全部低于 confirm-mask(9999)。
 * ============================================================== */

/* 中枢入口是页面级操作, 收进 nav-bar 右侧, 不占用也不遮挡消息流 */

.nexus-capsule {
    margin-left: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    appearance: none;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    font-size: 12px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.nexus-capsule:active { transform: scale(0.96); }
@media (hover: hover) {
    .nexus-capsule:hover { background: #fff; border-color: var(--border-strong); }
}

/* 呼吸灯: 系统活着的信号 */
.nexus-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: nexus-breathe 2.4s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes nexus-breathe {
    0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35); }
    50%      { opacity: 0.55; box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

/* 未读角标 */
.nexus-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--accent-red);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}

/* ---------- 遮罩 + 底部上滑卡 ---------- */
.nexus-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 950;
}
.nexus-mask.show { display: block; }

.nexus-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 74vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-page);
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: nexus-slide-up 0.22s ease-out;
}
@keyframes nexus-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* 电脑端改成居中对话框; 手机端仍保持顺手的底部抽屉 */
@media (min-width: 640px) {
    .nexus-sheet {
        left: 50%;
        right: auto;
        top: 50%;
        bottom: auto;
        width: min(480px, calc(100vw - 48px));
        min-height: min(420px, calc(100vh - 48px));
        max-height: min(680px, calc(100vh - 48px));
        padding-bottom: 0;
        border-radius: 18px;
        box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
        transform: translate(-50%, -50%);
        animation: nexus-dialog-in 0.2s ease-out;
    }
}

@keyframes nexus-dialog-in {
    from { transform: translate(-50%, calc(-50% + 16px)); opacity: 0; }
    to   { transform: translate(-50%, -50%); opacity: 1; }
}

.nexus-sheet-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.nexus-sheet-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.nexus-sheet-sub   { font-size: 11px; color: var(--text-muted); margin-left: 2px; }
.nexus-close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

/* ---------- 时间线主体 ---------- */
.nexus-tl {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px 20px;
}

.nexus-row {
    display: flex;
    gap: 10px;
    cursor: pointer;
}
.nexus-row.idle { cursor: default; }

/* 左轨: 圆点 + 连到下一条的竖线 */
.nexus-row-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 12px;
    flex-shrink: 0;
}
.nexus-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}
.nexus-dot.small { width: 6px; height: 6px; background: var(--border-strong); margin-top: 7px; }
.nexus-line { width: 2px; flex: 1; background: var(--border); margin: 3px 0 0; }
.nexus-row:last-child .nexus-line,
.nexus-row:has(+ .nexus-more) .nexus-line { background: transparent; }

.nexus-row-body { flex: 1; padding-bottom: 16px; min-width: 0; }

.nexus-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.nexus-kind { font-size: 11px; font-weight: 600; }
.nexus-sym  { font-size: 11px; font-family: var(--font-mono); color: var(--text-secondary); }
.nexus-time { font-size: 11px; color: var(--text-muted); margin-left: auto; }

.nexus-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    word-break: break-word;
}
.nexus-text.muted { font-size: 12px; color: var(--text-muted); }

/* 整点选币的席位表(PICK 合并成一条之后, 逐席摊开;不用展开就能看到决策路线) */
.nexus-slots {
    margin-top: 6px;
    border-left: 2px solid var(--border);
    padding-left: 8px;
}
.nexus-slot {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1.9;
    white-space: nowrap;
    overflow: hidden;
}
.nexus-slot-no {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
}
.nexus-slot-sym {
    font-family: var(--font-mono);
    color: var(--text-primary);
}
.nexus-slot-grp {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}
.nexus-slot-tag {
    flex-shrink: 0;
    font-size: 10px;
    padding: 0 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
}
.nexus-slot-score {
    flex-shrink: 0;
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

/* 明细展开(data_json 的人话字段表) */
.nexus-detail {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.nexus-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    line-height: 1.9;
}
.nexus-detail-row span:first-child { color: var(--text-muted); flex-shrink: 0; }
.nexus-detail-row span:last-child  { color: var(--text-primary); text-align: right; word-break: break-all; }

/* 翻页按钮 */
.nexus-more {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 10px 0;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}
.nexus-more:active { background: var(--bg-hover); }
