/* ==================== 用户卡片 (主页顶部) ==================== */
.user-card {
    background: var(--bg-card);
    margin: 12px 16px 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    display: flex; align-items: center; gap: 14px;
}
.toggle-track {
    position: relative;
    width: 44px; height: 26px;
    background: var(--border-strong);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
}
.toggle-track.on { background: var(--accent-blue); }
.toggle-thumb {
    position: absolute; top: 2px; left: 2px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: left 0.25s;
}
.toggle-track.on .toggle-thumb { left: 20px; }

.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 15px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 1px;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar svg { width: 100%; height: 100%; }

/* ==================== Quick Task 卡片 (类似 Exit Node) ==================== */
.quick-task-card {
    background: var(--bg-card);
    margin: 0 16px 16px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.quick-task-card:active { background: var(--bg-hover); }
.quick-task-left { flex: 1; min-width: 0; }
.quick-task-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.quick-task-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 6px;
}
.quick-task-value .arrow {
    font-size: 11px; color: var(--text-muted);
}
.quick-task-btn {
    background: linear-gradient(135deg, var(--agent-grad-a), var(--agent-grad-b));
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
}
.quick-task-btn:active { opacity: 0.7; }

/* ==================== 搜索框 (主页) ==================== */
.search-trigger {
    margin: 0 16px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 11px 16px;
    display: flex; align-items: center; gap: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    color: var(--text-muted);
    font-size: 14px;
    transition: background 0.15s;
}
.search-trigger:active { background: var(--bg-hover); }
.search-trigger svg {
    width: 16px; height: 16px;
    flex-shrink: 0;
}

/* ==================== 段落标题 ==================== */
.section-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 20px 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.section-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    font-family: var(--font-mono);
}

/* ==================== 列表卡片 ==================== */
.list-card {
    background: var(--bg-card);
    margin: 0 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.list-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.list-row:last-child { border-bottom: none; }
.list-row:active { background: var(--bg-hover); }

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}
.status-dot.online { background: var(--accent-green); }

/* 候选池已经按强度排序: 用排名替代重复的黄色状态点, 信息更明确 */
.candidate-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 7px;
    background: rgba(99, 102, 241, 0.09);
    color: #6366f1;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.row-main { flex: 1; min-width: 0; }
.row-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap;
}
.row-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    font-family: var(--font-mono);
    display: flex; gap: 10px;
    flex-wrap: wrap;
}
.row-meta .pass { color: var(--accent-blue); font-weight: 600; }

.dir-tag {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}
.dir-tag.long { background: rgba(34,197,94,0.12); color: var(--accent-green); }
.dir-tag.short { background: rgba(239,68,68,0.12); color: var(--accent-red); }

.row-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 500;
    margin-left: 4px;
}

.row-extra {
    font-size: 10px;
    color: var(--accent-amber);
    font-family: var(--font-mono);
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}

/* OI 金额排名直接替代列表左侧状态圆点。 */
.oi-rank-badge {
    width: 26px;
    height: 24px;
    border-radius: 7px;
    background: rgba(99, 102, 241, 0.09);
    color: #6366f1;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.oi-rank-badge.top-three {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.candidate-extra {
    color: var(--text-secondary);
    font-weight: 500;
}

/* 持仓模块紧跟 System Channel; 与后面的搜索区留出清晰分组 */
#home-positions-section { margin-bottom: 18px; }

.target-emoji {
    font-size: 11px;
    margin-left: 2px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ==================== 保存按钮 ==================== */
.save-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 14px;
    background: linear-gradient(135deg, var(--agent-grad-a), var(--agent-grad-b));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
.save-btn:active { opacity: 0.8; }

.save-btn.secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    box-shadow: none;
}
.save-btn.secondary:active { background: var(--bg-hover); opacity: 1; }

/* ==================== Toast ==================== */
.toast {
    position: fixed; top: 24px; left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 999;
    padding: 12px 22px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
    max-width: 90%;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #1c1c1e; color: #fff; }
.toast.error   { background: #ef4444; color: #fff; }


/* 撤销按钮 */
.task-cancel-btn {
    margin-left: 8px;
    padding: 4px 10px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    cursor: pointer;
    white-space: nowrap;
}
.task-cancel-btn:active { background: rgba(239, 68, 68, 0.3); }

/* 确认弹窗 */
.confirm-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.confirm-mask.show { display: flex; }
.confirm-box {
    width: 100%;
    max-width: 320px;
    background: #1e2230;
    border-radius: 16px;
    padding: 22px 20px 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.confirm-title { font-size: 17px; font-weight: 600; color: #fff; margin-bottom: 10px; }
.confirm-msg   { font-size: 13px; color: #9aa3b2; line-height: 1.6; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-btn {
    flex: 1;
    padding: 11px 0;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}
.confirm-btn-cancel { background: rgba(255,255,255,.08); color: #cbd2dd; }
.confirm-btn-ok     { background: #ef4444; color: #fff; font-weight: 600; }
.confirm-btn-ok:active { background: #dc2626; }
.status-canceled  { color: #888; background: rgba(136,136,136,.12); }
.status-executing { color: #e0a000; background: rgba(224,160,0,.12); }

/* ==================== 已持仓 盈亏配色 / 徽章 ==================== */
.pnl-pos { color: var(--accent-green); font-weight: 700; }
.pnl-neg { color: var(--accent-red);   font-weight: 700; }

.pos-pnl { font-family: var(--font-mono); font-size: 13px; line-height: 1.3; }
.pos-roe { font-size: 9px; opacity: 0.85; }

.pos-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}
.pos-badge.holding { background: rgba(34,197,94,0.12);  color: var(--accent-green); }
.pos-badge.armed   { background: rgba(245,158,11,0.12); color: var(--accent-amber); }

/* 持仓所属子账号徽章 */
.pos-acct {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-blue);
}
